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))
.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<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":
@ -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;
}
return r;
});
break;