Make showClosed filter actually work

This commit is contained in:
regalijan 2023-10-19 16:49:31 -04:00
parent 8e5c3810a6
commit 8b15251bb3
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -49,9 +49,9 @@ export async function onRequestGet(context: RequestContext) {
const items = [];
const { results }: { results?: { created_at: number; id: string }[] } =
await context.env.D1.prepare(
"SELECT created_at, id FROM ? WHERE created_at < ? ORDER BY created_at DESC LIMIT 25;"
"SELECT created_at, id FROM ? WHERE created_at < ? AND open = ? ORDER BY created_at DESC LIMIT 25;"
)
.bind(table, before)
.bind(table, before, !showClosed)
.all();
if (results)