Remove redundant check from
This commit is contained in:
1 parent
2c408063ad
commit
17b8011ce1
1 file changed
+3
-4
@@ -402,14 +402,13 @@ const editMonitor = async (req, res, next) => {
|
|||||||
|
|
||||||
await req.db.deleteNotificationsByMonitorId(editedMonitor._id);
|
await req.db.deleteNotificationsByMonitorId(editedMonitor._id);
|
||||||
|
|
||||||
if (notifications && notifications.length !== 0) {
|
await Promise.all(
|
||||||
await Promise.all(
|
notifications &&
|
||||||
notifications.map(async (notification) => {
|
notifications.map(async (notification) => {
|
||||||
notification.monitorId = editedMonitor._id;
|
notification.monitorId = editedMonitor._id;
|
||||||
await req.db.createNotification(notification);
|
await req.db.createNotification(notification);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
// Delete the old job(editedMonitor has the same ID as the old monitor)
|
// Delete the old job(editedMonitor has the same ID as the old monitor)
|
||||||
await req.jobQueue.deleteJob(monitorBeforeEdit);
|
await req.jobQueue.deleteJob(monitorBeforeEdit);
|
||||||
|
|||||||
Reference in new issue
Block a user