diff --git a/Server/controllers/monitorController.js b/Server/controllers/monitorController.js index 5e3899005..c22bf50c3 100644 --- a/Server/controllers/monitorController.js +++ b/Server/controllers/monitorController.js @@ -158,6 +158,7 @@ const deleteMonitor = async (req, res, next) => { await req.jobQueue.deleteJob(monitor); await req.db.deleteChecks(monitor._id); await req.db.deleteAlertByMonitorId(monitor._id); + await req.db.deleteNotificationByMonitorId(monitor._id); /** * TODO * We should remove all checks and alerts associated with this monitor diff --git a/Server/db/mongo/MongoDB.js b/Server/db/mongo/MongoDB.js index de2b3466e..c03e2db1a 100644 --- a/Server/db/mongo/MongoDB.js +++ b/Server/db/mongo/MongoDB.js @@ -120,6 +120,11 @@ const { deleteMaintenanceWindowByUserId, } = require("./modules/maintenaceWindowModule"); +const { + createNotification, + getNotificationsByMonitorId, +} = require("./modules/notificationModule"); + module.exports = { connect, insertUser, @@ -162,4 +167,6 @@ module.exports = { deleteMaintenaceWindowById, deleteMaintenanceWindowByMonitorId, deleteMaintenanceWindowByUserId, + createNotification, + getNotificationsByMonitorId, };