diff --git a/packages/presentation/src/file.ts b/packages/presentation/src/file.ts index 9e18569b389..b526378f2b5 100644 --- a/packages/presentation/src/file.ts +++ b/packages/presentation/src/file.ts @@ -200,7 +200,7 @@ export async function deleteFile (id: string): Promise { } }) - if (resp.status !== 200) { + if (!resp.ok) { throw new Error('Failed to delete file') } } @@ -217,7 +217,7 @@ async function uploadFileWithFormData (file: File, uuid: string, uploadUrl: stri body: data }) - if (resp.status !== 200) { + if (!resp.ok) { if (resp.status === 413) { throw new PlatformError(new Status(Severity.ERROR, plugin.status.FileTooLarge, {})) } else {