diff --git a/functions/api/mod-queue/[type]/list.ts b/functions/api/mod-queue/[type]/list.ts index daa395a..a38ecf8 100644 --- a/functions/api/mod-queue/[type]/list.ts +++ b/functions/api/mod-queue/[type]/list.ts @@ -39,9 +39,11 @@ export async function onRequestGet(context: RequestContext): Promise { ) .bind(before, !Number(showClosed)) .all(); - rows.results.forEach((r) => { + rows.results = rows.results.map((r) => { r.user = JSON.parse(r.user); delete r.user.email; + + return r; }); break; @@ -63,6 +65,15 @@ export async function onRequestGet(context: RequestContext): Promise { ) .bind(before) .all(); + + rows.results.map((r) => { + r.decisions = JSON.parse(r.decisions); + r.user = JSON.parse(r.user); + + delete r.user.email; + + return r; + }); break; case "report": @@ -72,14 +83,17 @@ export async function onRequestGet(context: RequestContext): Promise { .bind(before, !Number(showClosed)) .all(); - rows.results.forEach((r) => { + rows.results = rows.results.map((r) => { r.attachments = JSON.parse(r.attachments); r.target_ids = JSON.parse(r.target_ids); r.target_usernames = JSON.parse(r.target_usernames); - if (!r.user) return; + if (r.user) { + r.user = JSON.parse(r.user); + delete r.user.email; + } - r.user = JSON.parse(r.user); + return r; }); break;