Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

93
Views
Validate post sub item in AdonisJs

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

{
  nfe: {
    codigo: '56456',
    motorista: 'NOME',
    contato: 'CONTATO',
    casa: true
  },
  fornecedor: 'ALIMENTOS',
  lab: 'sim',
}

Controller

await request.validate(NfeValidator)

Validator

public schema = schema.create({
    'nfe.codigo': schema.string({trim: true}, [rules.unique({table: 'nfes', column: 'codigo'})])
  })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

A field was included in the root of the request post to be checked.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!