From fe7850d347bae9d400264df8c1b5fcf0761fd3c8 Mon Sep 17 00:00:00 2001 From: Camila Espinoza <56554983+cami-espinozaq@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:45:02 +0100 Subject: [PATCH] Update prepareAssetUpload.js - log possible errors --- src/backend/prepareAssetUpload.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backend/prepareAssetUpload.js b/src/backend/prepareAssetUpload.js index 8de0f7dd1..ac1332913 100644 --- a/src/backend/prepareAssetUpload.js +++ b/src/backend/prepareAssetUpload.js @@ -19,6 +19,8 @@ export const handler = async (event) => { Key: `data/assets/${filename}`, } + console.log("prepareAssetUpload params", params) + try { await s3.headObject(params).promise() return respond.error(409, 'Asset already exists.', { exists: true }) @@ -26,6 +28,10 @@ export const handler = async (event) => { // Asset does not exist, which is good. Just continue. } + console.log("headObject works") + const uploadUrl = s3.getSignedUrl('putObject', params) + + console.log("uploadUrl is", uploadUrl) return respond.json(200, { uploadUrl }) }