From 959e5b4543c4ce201759fb22c539002fba0df539 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Thu, 11 Jan 2018 11:22:56 +0100 Subject: [PATCH] greuge validations --- services/client/common/models/greuge.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/client/common/models/greuge.js b/services/client/common/models/greuge.js index 7bacecc4e..8364011d5 100644 --- a/services/client/common/models/greuge.js +++ b/services/client/common/models/greuge.js @@ -1,4 +1,12 @@ module.exports = function(Self) { require('../methods/greuge/filter.js')(Self); require('../methods/greuge/totalGreuge.js')(Self); + + Self.validatesPresenceOf('description', 'amount', 'greugeTypeFk', { + message: 'Importe es un campo obligatorio' + }); + Self.validatesLengthOf('description', { + max: 45, + message: 'description es un campo max 45' + }); };