Include the other fields
This commit is contained in:
parent
bbca4a9513
commit
992a7129e3
@ -57,13 +57,16 @@ export async function loader({ context }: { context: RequestContext }) {
|
||||
|
||||
const today = new Date().toISOString().split("T").at(0);
|
||||
const { results } = await context.env.D1.prepare(
|
||||
"SELECT decisions, end, id, start, user FROM inactivity_notices WHERE start <= ?1 AND date(end, '+30 days') <= ?1; ",
|
||||
"SELECT decisions, departments, end, hiatus, id, start, user FROM inactivity_notices WHERE start <= ?1 AND date(end, '+30 days') <= ?1; ",
|
||||
)
|
||||
.bind(today)
|
||||
.all();
|
||||
|
||||
for (let i = 0; i < results.length; i++)
|
||||
for (let i = 0; i < results.length; i++) {
|
||||
results[i].decisions = JSON.parse(results[i].decisions as string);
|
||||
results[i].departments = JSON.parse(results[i].departments as string);
|
||||
results[i].user = JSON.parse(results[i].user as string);
|
||||
}
|
||||
|
||||
return results.filter((row) => {
|
||||
const decisionValues = Object.values(
|
||||
@ -76,7 +79,7 @@ export async function loader({ context }: { context: RequestContext }) {
|
||||
end: string;
|
||||
id: string;
|
||||
start: string;
|
||||
user: { email: string; id: string; username: string };
|
||||
user: { email?: string; id: string; username: string };
|
||||
}[];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user