Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix query
  • Loading branch information
regalijan committed Jan 25, 2025
1 parent bce2b33 commit e8eaa54
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/routes/inactivities.tsx
Expand Up @@ -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";
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e8eaa54

Please sign in to comment.