Count monitors by type

This commit is contained in:
Alex Holliday committed 2024-09-04 23:09:14 -07:00
1 parent 5609e54127
commit 8ea0ef77e9
1 file changed
+4 -1
+4 -1
View File
@@ -305,7 +305,10 @@ 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);
const monitorsCount = await Monitor.countDocuments({
teamId: req.params.teamId,
type,
});
// Pagination
let skip = 0;