Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More api problems
  • Loading branch information
regalijan committed May 12, 2024
1 parent 8f4947c commit d265436
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions functions/api/mod-queue/[type]/list.ts
Expand Up @@ -39,9 +39,11 @@ export async function onRequestGet(context: RequestContext): Promise<any> {
)
.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;

Expand All @@ -63,6 +65,15 @@ export async function onRequestGet(context: RequestContext): Promise<any> {
)
.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":
Expand All @@ -72,14 +83,17 @@ export async function onRequestGet(context: RequestContext): Promise<any> {
.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;
Expand Down

0 comments on commit d265436

Please sign in to comment.