Don't include user emails in mod queue api
This commit is contained in:
parent
73074254b6
commit
c187b6816b
@ -64,11 +64,17 @@ export async function onRequestGet(context: RequestContext) {
|
|||||||
|
|
||||||
if (results)
|
if (results)
|
||||||
for (const { id } of results) {
|
for (const { id } of results) {
|
||||||
const item = await context.env.DATA.get(`${prefix}_${id}`, {
|
const item: { [k: string]: any } | null = await context.env.DATA.get(
|
||||||
|
`${prefix}_${id}`,
|
||||||
|
{
|
||||||
type: "json",
|
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)), {
|
return new Response(JSON.stringify(items.filter((v) => v !== null)), {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user