-
Hi! Is there a way to validate the incoming request multiple times with different Validators. I tried to do it this way so that I could use my Validators in another controller. public async store ({request, response}: HttpContextContract) {
const metadata = await request.validate(ArticleStoreValidator)
const translation = await request.validate(ArticleTranslationStoreValidator)
const article = await Article.create(metadata)
await article.related('translations').create(translation)
await article.preload('translations')
return response.json(article)
} Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
vkaelin
Aug 18, 2020
Replies: 1 comment 2 replies
-
It actually works if I edit the For example: public cacheKey = `${this.ctx.routeKey}-translation` Is it the right thing to do ? |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
RomainLanz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It actually works if I edit the
cacheKey
of my ArticleTranslationStoreValidator Validator.For example:
Is it the right thing to do ?