mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
fix: implement feedback
This commit is contained in:
@ -38,7 +38,7 @@ const putFileInS3 = async (file: File) => {
|
||||
|
||||
const body = await file.arrayBuffer();
|
||||
|
||||
await fetch(url, {
|
||||
const reponse = await fetch(url, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/octet-stream',
|
||||
@ -46,6 +46,12 @@ const putFileInS3 = async (file: File) => {
|
||||
body,
|
||||
});
|
||||
|
||||
if (!reponse.ok) {
|
||||
throw new Error(
|
||||
`Failed to upload file "${file.name}", failed with status code ${reponse.status}`,
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
type: DocumentDataType.S3_PATH,
|
||||
data: key,
|
||||
|
||||
Reference in New Issue
Block a user