Add notifcations to getMonitorById as well
This commit is contained in:
1 parent
b126830110
commit
75a897716f
1 file changed
+2
-1
@@ -64,7 +64,8 @@ const getMonitorById = async (req, res) => {
|
||||
createdAt: sortOrder,
|
||||
})
|
||||
.limit(limit);
|
||||
const monitorWithChecks = { ...monitor.toObject(), checks };
|
||||
const notifications = await Notification.find({ monitorId: monitor._id });
|
||||
const monitorWithChecks = { ...monitor.toObject(), checks, notifications };
|
||||
return monitorWithChecks;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
|
||||
Reference in new issue
Block a user