u
This commit is contained in:
@@ -261,6 +261,15 @@ export function register(app, basePath = '') {
|
||||
const onlyUnpaid = req.query.onlyUnpaid === 'true';
|
||||
const onlyUndelivered = req.query.onlyUndelivered === 'true';
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
let seekMonths = undefined;
|
||||
if (req.query.seekMonths !== undefined && req.query.seekMonths !== '') {
|
||||
const parsedSeek = parseInt(req.query.seekMonths, 10);
|
||||
@@ -277,6 +286,7 @@ export function register(app, basePath = '') {
|
||||
search,
|
||||
onlyUnpaid: onlyUnpaid ? true : undefined,
|
||||
onlyUndelivered: onlyUndelivered ? true : undefined,
|
||||
entityId,
|
||||
seekMonths,
|
||||
});
|
||||
res.status(200).json(result);
|
||||
|
||||
Reference in New Issue
Block a user