Skip to content

Commit

Permalink
feat(TOP): agrega skip y limit listado reglas (#1756)
Browse files Browse the repository at this point in the history
  • Loading branch information
palita1991 committed Dec 7, 2022
1 parent 3c8eae5 commit 85e0e11
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/top/routes/reglas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ router.get('/reglas', async (req: Request, res, next) => {
if (req.query.prestacionDestino) {
query.where('destino.prestacion.conceptId').equals(req.query.prestacionDestino);
}

if (req.query.skip) {
query.skip(parseInt(req.query.skip || 0, 10));
}

if (req.query.limit) {
query.limit(parseInt(req.query.limit || 0, 10));
}

const reglas = await query.exec();
if (prestacionesPermisos && !raw) {
reglas.forEach(regla => {
Expand All @@ -112,6 +121,7 @@ router.get('/reglas', async (req: Request, res, next) => {
});
}


res.json(reglas);
});

Expand Down

0 comments on commit 85e0e11

Please sign in to comment.