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,