From 1d22fd91b13eb98222803a9b651b61d14b225743 Mon Sep 17 00:00:00 2001 From: Regalijan Date: Wed, 15 May 2024 14:56:08 -0400 Subject: [PATCH] Fix report fetch links --- functions/api/mod-queue/[type]/[id].ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/functions/api/mod-queue/[type]/[id].ts b/functions/api/mod-queue/[type]/[id].ts index e67e7a3..32309a2 100644 --- a/functions/api/mod-queue/[type]/[id].ts +++ b/functions/api/mod-queue/[type]/[id].ts @@ -42,11 +42,14 @@ export async function onRequestGet(context: RequestContext) { if (!item) return jsonError("Item not found", 404); - if ( - type === "report" && - (await context.env.DATA.get(`reportprocessing_${itemId}`)) - ) - return jsonError("Report is processing", 409); + if (type === "report") { + if (await context.env.DATA.get(`reportprocessing_${itemId}`)) + return jsonError("Report is processing", 409); + + item.attachments = JSON.parse(item.attachments); + item.target_ids = JSON.parse(item.target_ids); + item.target_usernames = JSON.parse(item.target_usernames); + } if (item.user) { item.user = JSON.parse(item.user);