2020-03-09 08:00:03 +00:00
|
|
|
import ngModule from '../../module';
|
|
|
|
import Descriptor from 'salix/components/descriptor';
|
|
|
|
|
|
|
|
class Controller extends Descriptor {
|
|
|
|
get role() {
|
|
|
|
return this.entity;
|
|
|
|
}
|
|
|
|
|
|
|
|
set role(value) {
|
|
|
|
this.entity = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
onDelete() {
|
2023-11-30 11:20:05 +00:00
|
|
|
return this.$http.delete(`VnRoles/${this.id}`)
|
2020-03-09 08:00:03 +00:00
|
|
|
.then(() => this.$state.go('account.role'))
|
|
|
|
.then(() => this.vnApp.showSuccess(this.$t('Role removed')));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngModule.component('vnRoleDescriptor', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
role: '<'
|
|
|
|
}
|
|
|
|
});
|