These need to still be parsed
This commit is contained in:
@@ -76,6 +76,11 @@ export async function onRequestGet(context: RequestContext): Promise<any> {
|
|||||||
SELECT *, (SELECT COUNT(*) FROM json_each(decisions)) AS decision_count FROM inactivity_notices WHERE created_at < datetime(${before} / 1000, 'unixepoch') AND decision_count ${showClosed ? raw("=") : raw("!=")} json_array_length(departments);`;
|
SELECT *, (SELECT COUNT(*) FROM json_each(decisions)) AS decision_count FROM inactivity_notices WHERE created_at < datetime(${before} / 1000, 'unixepoch') AND decision_count ${showClosed ? raw("=") : raw("!=")} json_array_length(departments);`;
|
||||||
|
|
||||||
rows.map((r) => {
|
rows.map((r) => {
|
||||||
|
// These come back as strings when using $queryRaw
|
||||||
|
r.decisions = JSON.parse(r.decisions as string);
|
||||||
|
r.departments = JSON.parse(r.departments as string);
|
||||||
|
r.user = JSON.parse(r.user as string);
|
||||||
|
|
||||||
delete (r.user as JsonObject).email;
|
delete (r.user as JsonObject).email;
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
|||||||
Reference in New Issue
Block a user