From c187b6816b8e734705018545ad5566b241dc5c4a Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:50:43 -0400 Subject: [PATCH] Don't include user emails in mod queue api --- functions/api/mod-queue/list.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/functions/api/mod-queue/list.ts b/functions/api/mod-queue/list.ts index f1a930f..a0f664e 100644 --- a/functions/api/mod-queue/list.ts +++ b/functions/api/mod-queue/list.ts @@ -64,11 +64,17 @@ export async function onRequestGet(context: RequestContext) { if (results) for (const { id } of results) { - const item = await context.env.DATA.get(`${prefix}_${id}`, { - type: "json", - }); + const item: { [k: string]: any } | null = await context.env.DATA.get( + `${prefix}_${id}`, + { + type: "json", + }, + ); - if (item) items.push({ ...item, id }); + if (item) { + delete item.user?.email; + items.push({ ...item, id }); + } } return new Response(JSON.stringify(items.filter((v) => v !== null)), {