From f6e68d4117d45b85e4c37b3f1b063bbdb1d3f7c1 Mon Sep 17 00:00:00 2001 From: Thanu Poptiphueng Date: Sun, 21 Apr 2024 22:09:40 +0700 Subject: [PATCH] fix: more strict equality check --- src/userRoute.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/userRoute.ts b/src/userRoute.ts index 43e11ee..f547190 100644 --- a/src/userRoute.ts +++ b/src/userRoute.ts @@ -128,10 +128,10 @@ async function getAllUserCount( return []; } let conditions: SQL[] = []; - if (group) { + if (group !== undefined) { conditions.push(eq(user.group, group)); } - if (zoneId) { + if (zoneId !== undefined) { conditions.push(eq(user.zone, zoneId)); } if (zoneIds.length > 0) { @@ -169,10 +169,10 @@ async function getAllUser( offset, where: (user, { eq, and }) => { let conditions: SQL[] = []; - if (group) { + if (group !== undefined) { conditions.push(eq(user.group, group)); } - if (zoneId) { + if (zoneId !== undefined) { conditions.push(eq(user.zone, zoneId)); } if (zoneIds.length > 0) {