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

33 lines
761 B
JavaScript
Raw Normal View History

2019-03-08 08:41:53 +00:00
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'];
2019-03-08 08:41:53 +00:00
ngModule.component('vnWorkerPbx', {
template: require('./index.html'),
controller: Controller,
2019-03-08 08:41:53 +00:00
bindings: {
worker: '<'
}
});