More api problems

This commit is contained in:
Regalijan 2024-05-12 01:47:05 -04:00
parent 8f4947c8ac
commit d265436555
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -39,9 +39,11 @@ export async function onRequestGet(context: RequestContext): Promise<any> {
) )
.bind(before, !Number(showClosed)) .bind(before, !Number(showClosed))
.all(); .all();
rows.results.forEach((r) => { rows.results = rows.results.map((r) => {
r.user = JSON.parse(r.user); r.user = JSON.parse(r.user);
delete r.user.email; delete r.user.email;
return r;
}); });
break; break;
@ -63,6 +65,15 @@ export async function onRequestGet(context: RequestContext): Promise<any> {
) )
.bind(before) .bind(before)
.all(); .all();
rows.results.map((r) => {
r.decisions = JSON.parse(r.decisions);
r.user = JSON.parse(r.user);
delete r.user.email;
return r;
});
break; break;
case "report": case "report":
@ -72,14 +83,17 @@ export async function onRequestGet(context: RequestContext): Promise<any> {
.bind(before, !Number(showClosed)) .bind(before, !Number(showClosed))
.all(); .all();
rows.results.forEach((r) => { rows.results = rows.results.map((r) => {
r.attachments = JSON.parse(r.attachments); r.attachments = JSON.parse(r.attachments);
r.target_ids = JSON.parse(r.target_ids); r.target_ids = JSON.parse(r.target_ids);
r.target_usernames = JSON.parse(r.target_usernames); r.target_usernames = JSON.parse(r.target_usernames);
if (!r.user) return; if (r.user) {
r.user = JSON.parse(r.user); r.user = JSON.parse(r.user);
delete r.user.email;
}
return r;
}); });
break; break;