Fix logic to get accurate results.
This commit is contained in:
1 parent
44fd1f8898
commit
8f58b6e438
1 file changed
+2
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user