I want to create an action that looks like this:
submitProject: defineAction({
accept: "form",
input: z.object({
presentationPicture: z.instanceof(File).optional(),
name: z.string(),
summary: z.string(),
teamMembers: z.number(),
nature: z.string(),
date: z.string(),
description: z.string().optional(),
showcase: z.boolean(),
skills: z.string().optional(),
github: z.string().optional(),
link: z.string().optional(),
existingPreviews: z.string().optional(),
}),
handler: async (obj, context) => {
console.log("handling project's submission");
console.log(obj);
console.dir(context, { depth: null });
return {
success: true,
};
},
}),
but my form has an unknown number of inputs of type "file". How do I handle those files in the handler function ?