Refactor getChecksByUserId to getChecksByTeamId
This commit is contained in:
1 parent
c8c2dfe9ec
commit
eedc6bbed6
8 files changed
+27
-31
No files matched your search
@@ -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,
|
||||
};
|
||||
Reference in new issue
Block a user