Call unsuccessfull after 7 tries
Unanswered
Elm sawfly posted this in #help-forum
Elm sawflyOP
It is showing that the error is on line
Code that is on line 45 is:
EventForm.tsx:45
async function onSubmit(values: z.infer<typeof eventFormSchema>) {
let uploadedImageUrl = values.imageUrl;
if (files.length > 0) {
const uploadedImages = await startUpload(files);
if (!uploadedImages) return;
uploadedImageUrl = uploadedImages[0].url
}
if (type === "Create") {
try {
const newEvent = await createEvent({
event: { ...values, imageUrl: uploadedImageUrl },
userId,
path: "/profile"
})
if (newEvent) {
form.reset();
router.push(`/events/${newEvent._id}`)
}
} catch (error) {
console.log(error);
};
};
};
Code that is on line 45 is:
const uploadedImages = await startUpload(files);
1 Reply
Elm sawflyOP
That
stopUpload
comes from uploadThing
const { startUpload } = useUploadThing('imageUploader');