Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Include the other fields
  • Loading branch information
regalijan committed Jan 23, 2025
1 parent bbca4a9 commit 992a712
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/routes/inactivities.tsx
Expand Up @@ -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(
Expand All @@ -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 };
}[];
}

Expand Down

0 comments on commit 992a712

Please sign in to comment.