From 775cc2e1dbf5ca70ac7feff520baa85fcfd76281 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Thu, 11 May 2023 11:02:08 +0200 Subject: [PATCH] fixup where --- server/utils/baaPagination.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/utils/baaPagination.ts b/server/utils/baaPagination.ts index 6978a6a..e230763 100644 --- a/server/utils/baaPagination.ts +++ b/server/utils/baaPagination.ts @@ -67,7 +67,7 @@ export default class BaaPagination = [], ) { - const sqlwhere = where ? `AND (${where})` : ""; + const sqlwhere = where !== "" ? `AND (${where})` : ""; switch (queryType.type) { case "before": { const [data] = await database.query( @@ -232,7 +232,7 @@ export default class BaaPagination = [], ) { - const sqlwhere = where ? `WHERE ${where}` : ""; + const sqlwhere = where !== "" ? `WHERE ${where}` : ""; const [[data]] = await database.query( `SELECT COUNT(*) as \`count\` FROM \`${this.table}\` ${sqlwhere}`, bind,