salix/modules/account/front/mail-forwarding/index.js

27 lines
729 B
JavaScript

import ngModule from '../module';
import Section from 'salix/components/section';
import UserError from 'core/lib/user-error';
export default class Controller extends Section {
onSubmit() {
this.getIsAuthorized();
}
getIsAuthorized() {
this.$http.get(`Workers/${this.$params.id}/isSubordinate`)
.then(res => {
this.isSubordinate = res.data;
if (!this.isSubordinate) throw new UserError(`You don't have enough privileges`);
this.$.watcher.submit();
});
}
}
ngModule.component('vnUserMailForwarding', {
template: require('./index.html'),
controller: Controller,
require: {
card: '^vnUserCard'
},
});