Fix logic to get accurate results.

This commit is contained in:
M M committed 2024-08-31 22:46:28 -07:00
1 parent 44fd1f8898
commit 8f58b6e438
1 file changed
+2 -2
+2 -2
View File
@@ -24,10 +24,10 @@ const createCheck = async (checkData) => {
try {
const { monitorId, status } = checkData;
const check = await new Check({ ...checkData }).save();
const n = await Check.countDocuments({ monitorId }) + 1;
const check = await new Check({ ...checkData }).save();
const monitor = await Monitor.findById(monitorId);
if (!monitor) {