validacion prueba

This commit is contained in:
Javi Gallego 2017-01-12 11:02:22 +01:00
parent a52ffbc9a3
commit 4d9e3d2684
9 changed files with 25 additions and 10 deletions

View File

@ -9,15 +9,15 @@
},
"street": {
"type": "string",
"required": "true"
"required": true
},
"consignee": {
"type": "string",
"required": "true"
"required": true
},
"city": {
"type": "string",
"required": "true"
"required": true
},
"postcode": {
"type": "string"

View File

@ -9,7 +9,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
}
}
}

View File

@ -0,0 +1,14 @@
module.exports = function(Client) {
// prueba uno
// Client.validatesUniquenessOf('name', {message: 'el nombre debe ser unico'});
// prueba dos
Client.validate('name',hasCC,{message: 'Introducir cuenta bancaria'});
function hasCC(err) {
if (this.payMethod == 2) err();
}
};

View File

@ -1,6 +1,7 @@
{
"name": "Client",
"base": "PersistedModel",
"validateUpsert": true,
"properties": {
"id": {
"type": "Number",
@ -9,7 +10,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
},
"fi": {
"type": "string",

View File

@ -9,7 +9,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
}
}
}

View File

@ -9,7 +9,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
}
}
}

View File

@ -9,7 +9,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
}
}
}

View File

@ -9,7 +9,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
}
}
}

View File

@ -9,7 +9,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
},
"active": {
"type": "boolean"