#1265 worker.pbx da error si no tiene extensión
This commit is contained in:
parent
1d6aeae7de
commit
14bd970fbc
|
@ -0,0 +1,11 @@
|
|||
module.exports = Self => {
|
||||
// Validations
|
||||
|
||||
Self.validatesUniquenessOf('extension', {
|
||||
message: `The extension must be unique`
|
||||
});
|
||||
|
||||
Self.validatesPresenceOf('secret', {
|
||||
message: `The secret can't be blank`
|
||||
});
|
||||
};
|
|
@ -73,5 +73,7 @@
|
|||
"Street cannot be empty": "Dirección no puede estar en blanco",
|
||||
"City cannot be empty": "Cuidad no puede estar en blanco",
|
||||
"Code cannot be blank": "Código no puede estar en blanco",
|
||||
"You cannot remove this department": "No puedes eliminar este departamento"
|
||||
"You cannot remove this department": "No puedes eliminar este departamento",
|
||||
"The extension must be unique": "La extensión debe ser unica",
|
||||
"The secret can't be blank": "La contraseña no puede estar en blanco"
|
||||
}
|
|
@ -1,11 +1,8 @@
|
|||
<mg-ajax path="/api/Sips/{{patch.params.id}}" options="vnPatch"></mg-ajax>
|
||||
<vn-watcher
|
||||
vn-id="watcher"
|
||||
data="$ctrl.worker.sip"
|
||||
form="form"
|
||||
save="patch">
|
||||
data="$ctrl.worker.sip">
|
||||
</vn-watcher>
|
||||
<form name="form" ng-submit="watcher.submit()" compact>
|
||||
<form name="form" ng-submit="$ctrl.onSubmit()" compact>
|
||||
<vn-card pad-large>
|
||||
<vn-vertical>
|
||||
<vn-horizontal>
|
||||
|
|
|
@ -1,7 +1,31 @@
|
|||
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: '<'
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue