mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-14 05:39:50 -06:00
Add notifications to single monitor
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user