Validate post sub item in AdonisJs #3507
Answered
by
arthur-er
marcelodelta
asked this question in
Help
-
Validate post sub item in AdonisJs. I can't validate a sub item of the post. I believe it is not found. I need to validate "codigo" that is inside "nfe" Request
Controller
Validator
|
Beta Was this translation helpful? Give feedback.
Answered by
arthur-er
Jan 22, 2022
Replies: 1 comment
-
You can use the nfe: schema.object().members({
codigo: schema.string({ trim: true }, [rules.unique({ table: 'nfes', column: 'codigo' })]),
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
thetutlage
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the
schema.object
to validate objects, the shape would look something like this