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" } }