Add update hook

This commit is contained in:
Alex Holliday committed 2024-09-04 18:42:50 -07:00
1 parent 1212a273aa
commit bc7f110b01
4 files changed
+29 -13

No files matched your search

+2 -1
View File
@@ -396,6 +396,7 @@ const getMonitorsByTeamId = async (req, res) => {
let { limit, type, status, sortOrder, normalize, page, rowsPerPage } =
req.query || {};
const monitorQuery = { teamId: req.params.teamId };
const monitorsCount = await Monitor.countDocuments(monitorQuery);
// Pagination
let skip = 0;
@@ -449,7 +450,7 @@ const getMonitorsByTeamId = async (req, res) => {
return { ...monitor.toObject(), checks };
})
);
return monitorsWithChecks;
return { monitors: monitorsWithChecks, monitorCount: monitorsCount };
} catch (error) {
throw error;
}