Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't include user emails in mod queue api
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 7307425 commit c187b68
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions functions/api/mod-queue/list.ts
Expand Up @@ -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)), {
Expand Down

0 comments on commit c187b68

Please sign in to comment.