From 0cddcbf4a923815294370744d2acbc6c301cfcb8 Mon Sep 17 00:00:00 2001 From: Regalijan Date: Tue, 26 Mar 2024 03:25:04 -0400 Subject: [PATCH] Better attempt at finding the object --- functions/api/reports/complete.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/api/reports/complete.ts b/functions/api/reports/complete.ts index 4efccfb..31a9b28 100644 --- a/functions/api/reports/complete.ts +++ b/functions/api/reports/complete.ts @@ -41,7 +41,9 @@ export async function onRequestPost(context: RequestContext) { for (const attachment of coconutData.attachments) { const token = crypto.randomUUID(); - const objectMeta = await context.env.R2.head(`t/${attachment}`); + const objectMeta = ( + await context.env.R2.list({ prefix: `t/${attachment}.` }) + ).objects.at(0); if (!objectMeta) continue;