fix: undefined value on ids search

This commit is contained in:
Julian Krauser 2025-01-20 12:25:57 +01:00
parent 9734149848
commit 0bbe22e9ae

View file

@ -62,7 +62,10 @@ export async function getAllMembers(req: Request, res: Response): Promise<any> {
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 });