-
-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array of object with file and a string field throwing "string field must be defined" message always. #4777
Comments
Hey @mdthansil! 👋🏻 What's the content of |
When I use {
images: [ { title: 'Title 1' }, { title: 'Title 2' }, { title: 'Title 3' } ]
} |
Hi @RomainLanz any updates on this? |
It looks like if should work fine. |
hi @RomainLanz Here is the link to the repository. |
Hey @RomainLanz 👋 Please note that The issue only occurs when we use tags: vine.array(vine.object({ key: vine.string(), value: vine.string() })) functions correctly. However, when we attempt something like this: images: vine.array(vine.object({ file: vine.file({ size: '2mb' }), title: vine.string() })) we receive an error stating that the field must be defined. |
I think this issue was reported earlier as-well (maybe in the Discord). The files and the request body are two different objects and hence when you expect them to be present together than you will have to self define the For example, you can use the import merge from 'deepmerge'
request.validateUsing(validator, {
data: merge(request.all(), request.allFiles())
}) |
Package version
Adonis Core Version: 6.14.1, vineJS version: 2.1.0
Describe the bug
Using Adonisjs with inertia + vue(SSR)
Reproduction repo
No response
The text was updated successfully, but these errors were encountered: