yolo
Explore posts from serversTTCTheo's Typesafe Cult
•Created by yolo on 4/18/2024 in #questions
zod validation with uploadthing and server actions
Does anyone know how i can handle with image upload to supabase. I have problem with zod schema with next js server action.
I have custom hook for upload image and saving file.url from uploadthing and first wanna check with like z.array(instanceof(File) then later have another images array where i save urls of images to db
I tried to make separated schema validation just for file and then merge with bigger schema to save all form in db but have conflict like having files array and dont have field prisma schema for that.
Tried also to set these merged schema only for useForm and resolver,set submit form function only sending values from bigger (main) schema but for some reason backend still get that files array and cant save it .
7 replies