From f8a263cd1172c93ae534c4b0640c130fb552438d Mon Sep 17 00:00:00 2001 From: Botho <1258870+elbotho@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:48:30 +0100 Subject: [PATCH] refactor(editor): remove upload tagging code --- .../editor/src/plugins/image/utils/upload-file.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/editor/src/plugins/image/utils/upload-file.ts b/packages/editor/src/plugins/image/utils/upload-file.ts index 43d272ce32..175f13ab6b 100644 --- a/packages/editor/src/plugins/image/utils/upload-file.ts +++ b/packages/editor/src/plugins/image/utils/upload-file.ts @@ -63,17 +63,12 @@ async function uploadFile({ const data = (await result?.json()) as { signedUrl: string fileUrl: string - tagging: string } if (!data) return Promise.reject('Could not get signed URL') - const { signedUrl, fileUrl, tagging } = data + const { signedUrl, fileUrl } = data - const success = await uploadToBucket({ - file, - signedUrl, - tagging, - }) + const success = await uploadToBucket({ file, signedUrl }) if (!success) return Promise.reject('Could not upload file') return Promise.resolve(fileUrl) } @@ -88,19 +83,16 @@ const errorMessage = 'Error while uploading' async function uploadToBucket({ file, signedUrl, - tagging, }: { file: File signedUrl: string - tagging: string }) { const response = await fetch(signedUrl, { method: 'PUT', body: file, headers: { - 'Content-Type': file.type, - 'x-amz-tagging': tagging, 'Access-Control-Allow-Origin': '*', + 'Content-Type': file.type, }, }).catch((e) => { // eslint-disable-next-line no-console