limiting getChecks to the last 25 checks

This commit is contained in:
MuhammadKhalilzadeh committed 2024-07-08 10:50:57 +03:30
1 parent 5c9b111707
commit 6589d0ef06
3 files changed
+14 -5

No files matched your search

+1 -1
View File
@@ -416,7 +416,7 @@ const createCheck = async (checkData) => {
const getChecks = async (monitorId) => {
try {
const checks = await Check.find({ monitorId });
const checks = await Check.find({ monitorId }).sort({ createdAt: -1 }).limit(25);
return checks;
} catch (error) {
throw error;