From 0bbe22e9ae2bf841f52491b9c95c1026b8c4a9a1 Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Mon, 20 Jan 2025 12:25:57 +0100 Subject: [PATCH] fix: undefined value on ids search --- src/controller/admin/club/memberController.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controller/admin/club/memberController.ts b/src/controller/admin/club/memberController.ts index bfb952a..d4a9f7e 100644 --- a/src/controller/admin/club/memberController.ts +++ b/src/controller/admin/club/memberController.ts @@ -62,7 +62,10 @@ export async function getAllMembers(req: Request, res: Response): Promise { let count = parseInt((req.query.count as string) ?? "25"); let search = (req.query.search as string) ?? ""; let noLimit = req.query.noLimit === "true"; - let ids = (req.query.ids as string).split(",").map((i) => parseInt(i)); + let ids = ((req.query.ids ?? "") as string) + .split(",") + .filter((i) => i) + .map((i) => parseInt(i)); let [members, total] = await MemberService.getAll({ offset, count, search, noLimit, ids });