Fix query
This commit is contained in:
parent
bce2b33d03
commit
e8eaa54812
@ -13,12 +13,13 @@ import {
|
|||||||
TableCaption,
|
TableCaption,
|
||||||
TableContainer,
|
TableContainer,
|
||||||
Tbody,
|
Tbody,
|
||||||
Td, Th,
|
Td,
|
||||||
|
Th,
|
||||||
Thead,
|
Thead,
|
||||||
Tr,
|
Tr,
|
||||||
UnorderedList,
|
UnorderedList,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
useToast
|
useToast,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { useLoaderData } from "@remix-run/react";
|
import { useLoaderData } from "@remix-run/react";
|
||||||
import { useState } from "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 today = new Date().toISOString().split("T").at(0);
|
||||||
const { results } = await context.env.D1.prepare(
|
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)
|
.bind(today)
|
||||||
.all();
|
.all();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user