Make showClosed filter actually work
This commit is contained in:
parent
8e5c3810a6
commit
8b15251bb3
@ -49,9 +49,9 @@ export async function onRequestGet(context: RequestContext) {
|
|||||||
const items = [];
|
const items = [];
|
||||||
const { results }: { results?: { created_at: number; id: string }[] } =
|
const { results }: { results?: { created_at: number; id: string }[] } =
|
||||||
await context.env.D1.prepare(
|
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();
|
.all();
|
||||||
|
|
||||||
if (results)
|
if (results)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user