32 lines
729 B
JavaScript
32 lines
729 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
|
|
};
|
|
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: '<'
|
|
}
|
|
});
|