Notifications added to monitor object

This commit is contained in:
Alex Holliday committed 2024-08-30 13:03:59 -07:00
1 parent 7c247c0367
commit 7e90b5f48b
4 files changed
+15 -8

No files matched your search

+3 -1
View File
@@ -284,7 +284,9 @@ const getMonitorById = async (monitorId) => {
const notifications = await Notification.find({
monitorId: monitorId,
});
return { ...monitor.toObject(), notifications };
monitor.notifications = notifications;
const monitorWithNotifications = await monitor.save();
return monitorWithNotifications;
} catch (error) {
throw error;
}