salix/modules/worker/front/pbx/index.js

33 lines
761 B
JavaScript

import ngModule from '../module';
class Controller {
constructor($scope, $http) {
this.$scope = $scope;
this.$http = $http;
}
onSubmit() {
const sip = this.worker.sip;
const params = {
userFk: this.worker.userFk,
extension: sip.extension,
secret: sip.secret
};
this.$scope.watcher.check();
this.$http.patch('/api/Sips', params).then(() => {
this.$scope.watcher.updateOriginalData();
this.$scope.watcher.notifySaved();
});
}
}
Controller.$inject = ['$scope', '$http'];
ngModule.component('vnWorkerPbx', {
template: require('./index.html'),
controller: Controller,
bindings: {
worker: '<'
}
});