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

28 lines
738 B
JavaScript
Raw Normal View History

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}/authorizeSelfOrSuperior`)
.then(res => {
this.isAuthorized = res.data;
if (!this.isAuthorized) throw new UserError(`You don't have enough privileges`);
this.$.watcher.submit();
});
}
}
ngModule.component('vnUserMailForwarding', {
template: require('./index.html'),
controller: Controller,
require: {
card: '^vnUserCard'
},
});