This commit is contained in:
seb
2026-10-19 13:25:02 +02:00
parent 3450552f7c
commit 3f540de768
3 changed files with 22 additions and 1 deletions

View File

@@ -245,6 +245,15 @@ export function register(app, basePath = '') {
}
}
let entityId = undefined;
if (req.query.entityId !== undefined && req.query.entityId !== '') {
const parsedEntity = parseInt(req.query.entityId, 10);
if (!Number.isInteger(parsedEntity) || parsedEntity <= 0) {
return res.status(400).json({ error: 'entityId must be a positive integer' });
}
entityId = parsedEntity;
}
const search = typeof req.query.search === 'string' && req.query.search.trim() !== ''
? req.query.search.trim()
: undefined;
@@ -263,6 +272,7 @@ export function register(app, basePath = '') {
offset,
limit,
search,
entityId,
seekMonths,
});
res.status(200).json(result);