diff --git a/functions/api/mod-queue/[type]/[id].ts b/functions/api/mod-queue/[type]/[id].ts index 9f0167a..0766eb0 100644 --- a/functions/api/mod-queue/[type]/[id].ts +++ b/functions/api/mod-queue/[type]/[id].ts @@ -33,10 +33,16 @@ export async function onRequestGet(context: RequestContext) { status: 403, }); - let item = await context.env.DATA.get(`${types[type].prefix}${itemId}`); + let item: { + [k: string]: any; + } | null = await context.env.DATA.get(`${types[type].prefix}${itemId}`, { + type: "json", + }); if (!item) - item = await context.env.DATA.get(`closed${types[type].prefix}${itemId}`); + item = await context.env.DATA.get(`closed${types[type].prefix}${itemId}`, { + type: "json", + }); if ( type === "report" && @@ -49,7 +55,9 @@ export async function onRequestGet(context: RequestContext) { status: 409, }); - return new Response(item ? item : '{"error":"Not found"}', { + if (item) delete item.user?.email; + + return new Response(item ? JSON.stringify(item) : '{"error":"Not found"}', { headers: { "content-type": "application/json", },