removed validatesPresenceOf() from client and greuge to add required: true on their models

This commit is contained in:
Carlos Jimenez 2018-01-11 22:11:35 +01:00
parent 5f1c0a0e5a
commit bb06a54df2
4 changed files with 8 additions and 10 deletions

View File

@ -24,9 +24,6 @@ module.exports = function(Self) {
Self.validatesUniquenessOf('fi', {
message: 'El NIF/CIF debe ser único'
});
Self.validatesPresenceOf('socialName', {
message: 'Debe especificarse la razón social'
});
Self.validatesUniquenessOf('socialName', {
message: 'La razón social debe ser única'
});

View File

@ -22,7 +22,8 @@
"description": "Fiscal indentifier"
},
"socialName": {
"type": "string"
"type": "string",
"required": true
},
"contact": {
"type": "string"

View File

@ -2,9 +2,6 @@ module.exports = function(Self) {
require('../methods/greuge/filter.js')(Self);
require('../methods/greuge/totalGreuge.js')(Self);
Self.validatesPresenceOf('description', 'amount', 'greugeTypeFk', {
message: 'Este campo es obligatorio'
});
Self.validatesLengthOf('description', {
max: 45,
message: 'La description debe tener maximo 45 caracteres'

View File

@ -14,10 +14,12 @@
"description": "Identifier"
},
"description": {
"type": "String"
"type": "String",
"required": true
},
"amount": {
"type": "Number"
"type": "Number",
"required": true
},
"shipped": {
"type": "date"
@ -35,7 +37,8 @@
"greugeType": {
"type": "belongsTo",
"model": "GreugeType",
"foreignKey": "greugeTypeFk"
"foreignKey": "greugeTypeFk",
"required": true
}
}
}