From 8b15251bb3dd28b16824d9e76865d349eeeab77e Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:49:31 -0400 Subject: [PATCH] Make showClosed filter actually work --- functions/api/mod-queue/list.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/api/mod-queue/list.ts b/functions/api/mod-queue/list.ts index 9a829cc..6f1f709 100644 --- a/functions/api/mod-queue/list.ts +++ b/functions/api/mod-queue/list.ts @@ -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)