Replies: 3 comments
-
Hey @LeFlow! 👋🏻 Where did you see this syntax? categoryId: vine.number().exists( Category.table, Category.primaryKey ) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Nowhere, it's just an (unsuccessful) attempt on my part :( |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can try creating custom rules for it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
hi.
I have a "posts" table which contains a foreign key corresponding to the ID of the "categories" table so 2 models
and
I'm trying to make a "postValidator".
A priori, on Adonisjs 5, the code is:
But on Adonis 6, it's not the same.
I tried to do
which works
But when, to validate the category linked to the post, I added :
categoryId: vine.number().exists( Category.table, Category.primaryKey )
following :
online: vine.boolean().nullable().optional(),
It dont work
It shows me that none of the form fields are valid.
My IDE displays the message: : Expected 1 arguments, but got 2.
Beta Was this translation helpful? Give feedback.
All reactions