From 4bc1cf455bff7dd529417f89cd808d6f2daa264b Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Fri, 10 Mar 2017 11:18:16 +0100 Subject: [PATCH] notes: Crear --- client/client/src/new-note/index.js | 2 +- services/client/common/models/ClientObservation.js | 9 ++++----- services/client/common/models/ClientObservation.json | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/client/client/src/new-note/index.js b/client/client/src/new-note/index.js index 2658df2a6..e4001c688 100644 --- a/client/client/src/new-note/index.js +++ b/client/client/src/new-note/index.js @@ -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') ); } diff --git a/services/client/common/models/ClientObservation.js b/services/client/common/models/ClientObservation.js index 3338e33e9..046baf646 100644 --- a/services/client/common/models/ClientObservation.js +++ b/services/client/common/models/ClientObservation.js @@ -1,12 +1,11 @@ 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(); + if (!this.text) err(); } - ClientObservation.observe('before save', function (ctx, next) { + ClientObservation.observe('before save', function(ctx, next) { ctx.instance.creationDate = Date(); next(); }); -}; \ No newline at end of file +}; diff --git a/services/client/common/models/ClientObservation.json b/services/client/common/models/ClientObservation.json index 09d9cbc32..e4ed95743 100644 --- a/services/client/common/models/ClientObservation.json +++ b/services/client/common/models/ClientObservation.json @@ -24,9 +24,9 @@ "model": "SalesPerson", "foreignKey": "id" }, - "client": { + "clients": { + "type": "hasOne", "model": "Client", - "type": "belongsTo", "foreignKey": "id" } }