Notifications added to monitor object
This commit is contained in:
1 parent
7c247c0367
commit
7e90b5f48b
4 files changed
+15
-8
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user