query types

This commit is contained in:
Julian Krauser 2024-12-04 18:58:31 +01:00
parent 8f49533fcb
commit 7810f05513

View file

@ -22,6 +22,8 @@ export async function getCalendarItemsByTypes(req: Request, res: Response): Prom
throw new InternalException("set output query value to `ics` or `json` (defaults to `ics`)"); throw new InternalException("set output query value to `ics` or `json` (defaults to `ics`)");
} }
types = types.filter((t) => t);
let items: Array<calendar> = []; let items: Array<calendar> = [];
if (types.length != 0) { if (types.length != 0) {
let typeIds = await CalendarTypeService.getByTypes((types as Array<string>).map((t) => t.split(":")[0])); let typeIds = await CalendarTypeService.getByTypes((types as Array<string>).map((t) => t.split(":")[0]));