ciscoheat / sveltekit-superforms

Making SvelteKit forms a pleasure to use!
https://superforms.rocks
MIT License
2.26k stars 66 forks source link

nested data does not work correctly on objects inside the array #474

Closed binsarjr closed 2 months ago

binsarjr commented 3 months ago
Screenshot 2024-08-29 at 22 50 58

Schema:

Screenshot 2024-08-29 at 22 51 52

but instead it became an array like this

Screenshot 2024-08-29 at 22 53 34

i'm already using dataTypes:'json'

zerosym commented 3 months ago

Are you missing a period in the path?

<FormFileUpload 
    name={`ImgProduct[${i}] (missing period here?) img`}
/>
binsarjr commented 2 months ago
Screenshot 2024-09-01 at 10 38 56

Ah, sorry, it turns out I was wrong, it turns out that to create a nested value you have to create it programmatically like this. can't just write the input name directly in the input form

Thanks