2019-03-08 08:41:53 +00:00
|
|
|
import ngModule from '../module';
|
2020-03-18 11:55:22 +00:00
|
|
|
import Section from 'salix/components/section';
|
2019-03-08 08:41:53 +00:00
|
|
|
|
2020-03-18 11:55:22 +00:00
|
|
|
class Controller extends Section {
|
2019-03-29 09:51:02 +00:00
|
|
|
onSubmit() {
|
|
|
|
const sip = this.worker.sip;
|
|
|
|
const params = {
|
|
|
|
userFk: this.worker.userFk,
|
2019-06-17 09:14:45 +00:00
|
|
|
extension: sip.extension
|
2019-03-29 09:51:02 +00:00
|
|
|
};
|
2019-10-24 10:44:36 +00:00
|
|
|
this.$.watcher.check();
|
2019-10-24 22:53:53 +00:00
|
|
|
this.$http.patch('Sips', params).then(() => {
|
2019-10-24 10:44:36 +00:00
|
|
|
this.$.watcher.updateOriginalData();
|
|
|
|
this.vnApp.showSuccess(this.$t('Data saved! User must access web'));
|
2019-03-29 09:51:02 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 08:41:53 +00:00
|
|
|
ngModule.component('vnWorkerPbx', {
|
|
|
|
template: require('./index.html'),
|
2019-03-29 09:51:02 +00:00
|
|
|
controller: Controller,
|
2019-03-08 08:41:53 +00:00
|
|
|
bindings: {
|
|
|
|
worker: '<'
|
|
|
|
}
|
|
|
|
});
|