2019-03-08 08:41:53 +00:00
|
|
|
import ngModule from '../module';
|
2019-10-24 10:44:36 +00:00
|
|
|
import Component from 'core/lib/component';
|
2019-03-08 08:41:53 +00:00
|
|
|
|
2019-10-24 10:44:36 +00:00
|
|
|
class Controller extends Component {
|
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-03-29 09:51:02 +00:00
|
|
|
this.$http.patch('/api/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: '<'
|
|
|
|
}
|
|
|
|
});
|