Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Better attempt at finding the object
  • Loading branch information
regalijan committed Mar 26, 2024
1 parent 8803c74 commit 0cddcbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion functions/api/reports/complete.ts
Expand Up @@ -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;

Expand Down

0 comments on commit 0cddcbf

Please sign in to comment.