Remove redundant check from

This commit is contained in:
Alex Holliday committed 2024-10-24 12:00:13 +08:00
1 parent 2c408063ad
commit 17b8011ce1
1 file changed
+3 -4
+3 -4
View File
@@ -402,14 +402,13 @@ const editMonitor = async (req, res, next) => {
await req.db.deleteNotificationsByMonitorId(editedMonitor._id);
if (notifications && notifications.length !== 0) {
await Promise.all(
await Promise.all(
notifications &&
notifications.map(async (notification) => {
notification.monitorId = editedMonitor._id;
await req.db.createNotification(notification);
})
);
}
);
// Delete the old job(editedMonitor has the same ID as the old monitor)
await req.jobQueue.deleteJob(monitorBeforeEdit);