diff --git a/Server/db/mongo/modules/monitorModule.js b/Server/db/mongo/modules/monitorModule.js index 7a86f1891..e2e93bcfb 100644 --- a/Server/db/mongo/modules/monitorModule.js +++ b/Server/db/mongo/modules/monitorModule.js @@ -280,7 +280,11 @@ const getMonitorStatsById = async (req) => { const getMonitorById = async (monitorId) => { try { const monitor = await Monitor.findById(monitorId); - return monitor; + // Get notifications + const notifications = await Notification.find({ + monitorId: monitorId, + }); + return { ...monitor.toObject(), notifications }; } catch (error) { throw error; }