Add customization to limiting
This commit is contained in:
1 parent
98be150d6d
commit
3e6b9049ec
2 files changed
+12
-3
No files matched your search
@@ -42,8 +42,13 @@ const getChecks = async (req, res, next) => {
|
||||
return;
|
||||
}
|
||||
|
||||
let limitedTo = null;
|
||||
|
||||
try {
|
||||
const checks = await req.db.getChecks(req.params.monitorId);
|
||||
if (req.query && req.query.limit) {
|
||||
limitedTo = parseInt(req.query.limit);
|
||||
}
|
||||
const checks = await req.db.getChecks(req.params.monitorId, limitedTo);
|
||||
return res
|
||||
.status(200)
|
||||
.json({ success: true, msg: successMessages.CHECK_GET, data: checks });
|
||||
|
||||
Reference in new issue
Block a user