From 03ee67cfca51a680fcc7ff741872d59729d7ffc4 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 30 Jul 2024 13:23:14 -0700 Subject: [PATCH] Add methods to MongoDB --- Server/controllers/monitorController.js | 1 + Server/db/mongo/MongoDB.js | 7 +++++++ 2 files changed, 8 insertions(+) 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, };