notes: Crear
This commit is contained in:
parent
5e66bef50c
commit
4bc1cf455b
|
@ -11,7 +11,7 @@ class Controller {
|
|||
};
|
||||
}
|
||||
onSubmit() {
|
||||
this.element.querySelector('vn-watcher').$ctrl.submit().then (
|
||||
this.element.querySelector('vn-watcher').$ctrl.submit().then(
|
||||
() => this.$state.go('clientCard.notes')
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
module.exports = function(ClientObservation) {
|
||||
|
||||
ClientObservation.validate('text',isEnabled,{message: 'Se debe rellenar el campo de texto'});
|
||||
ClientObservation.validate('text', isEnabled, {message: 'Se debe rellenar el campo de texto'});
|
||||
function isEnabled(err) {
|
||||
if (!this.text) err();
|
||||
}
|
||||
|
||||
ClientObservation.observe('before save', function (ctx, next) {
|
||||
ClientObservation.observe('before save', function(ctx, next) {
|
||||
ctx.instance.creationDate = Date();
|
||||
next();
|
||||
});
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
"model": "SalesPerson",
|
||||
"foreignKey": "id"
|
||||
},
|
||||
"client": {
|
||||
"clients": {
|
||||
"type": "hasOne",
|
||||
"model": "Client",
|
||||
"type": "belongsTo",
|
||||
"foreignKey": "id"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue