Handle upload failures
This commit is contained in:
parent
a02cecb23b
commit
5f9dfb76e7
@ -152,6 +152,24 @@ export default function (props: { isOpen: boolean; onClose: () => void }) {
|
|||||||
},
|
},
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!fileUpload.ok) {
|
||||||
|
await fetch("/api/reports/recall", {
|
||||||
|
body: JSON.stringify({ id }),
|
||||||
|
headers: {
|
||||||
|
"content-type": "application/json",
|
||||||
|
},
|
||||||
|
method: "POST",
|
||||||
|
});
|
||||||
|
|
||||||
|
useToast()({
|
||||||
|
description: "Failed to upload file",
|
||||||
|
status: "error",
|
||||||
|
title: "Error",
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user