Refactor getChecksByUserId to getChecksByTeamId

This commit is contained in:
Alex Holliday committed 2024-08-27 12:22:32 -07:00
1 parent c8c2dfe9ec
commit eedc6bbed6
8 files changed
+27 -31

No files matched your search

+4 -4
View File
@@ -116,12 +116,12 @@ const getChecks = async (req) => {
}
};
const getUserChecks = async (req) => {
const { userId } = req.params;
const getTeamChecks = async (req) => {
const { teamId } = req.params;
let { sortOrder, limit, dateRange, filter, page, rowsPerPage } = req.query;
// Get monitorIDs
const userMonitors = await Monitor.find({ userId: userId });
const userMonitors = await Monitor.find({ teamId: teamId });
const monitorIds = userMonitors.map((monitor) => monitor._id);
//Build check query
@@ -189,6 +189,6 @@ module.exports = {
createCheck,
getChecksCount,
getChecks,
getUserChecks,
getTeamChecks,
deleteChecks,
};