[{
“salesconsultant”: “test”,
“orderdate”: “06/21”,
“account”: “009l”,
“sport”: “testsport”,
“product”: “prod1”,
“purchasequantity”: 45,
“revenue”: 45,
“leadsource”: “test-1”
},{
“salesconsultant”: “test”,
“orderdate”: “06/21”,
“account”: “009l”,
“sport”: “testsport”,
“product”: “prod1”,
“purchasequantity”: 45,
“revenue”: 45,
“leadsource”: “test-1”
},…]
I want to validate each fields of an object.
Thanks in advance
Validating array of objects
ya…But i didn’t find anything to validating nested object values.
it worked for me but the validation messages did not work, can you tell me how to fit in custom error messages?
Thank`s Guy
get rules() {
return {
// validation rules
// validation rules
'enderecos.*.ds_cep': 'required'
}
}
get messages() {
return {
'enderecos.*.ds_cep': 'Você deve escolher um cep válido',
}
}
Hey @diogon01!
You need to add the name of the rule after your key.
'enderecos.*.ds_cep'
must become 'enderecos.*.ds_cep.required'
.
1 Like
Not working
Page not found sir.
I want to implement something similar but the link in the answer given shows a “Page not found” message.
Yes, but AdonisJs uses the old version of Indicative, so I suggest everyone not to refer the new docs at all. This is where everyone should go.