Merge pull request #763 from bluewave-labs/fix/config-monitor-notifications

Add notifications to single monitor
This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-08-30 10:49:44 -07:00
commit 5159b9cb56
1 file changed
+5 -1
+5 -1
View File
@@ -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;
}