Fix query

This commit is contained in:
Regalijan 2025-01-25 00:40:53 -05:00
parent bce2b33d03
commit e8eaa54812
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -13,12 +13,13 @@ import {
TableCaption,
TableContainer,
Tbody,
Td, Th,
Td,
Th,
Thead,
Tr,
UnorderedList,
useDisclosure,
useToast
useToast,
} from "@chakra-ui/react";
import { useLoaderData } from "@remix-run/react";
import { useState } from "react";
@ -57,7 +58,7 @@ 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, departments, end, hiatus, 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 end >= date($1, '-1 month') ORDER BY end;",
)
.bind(today)
.all();