Refactor getMonitorByUserID to getMonitorByTeamID
This commit is contained in:
1 parent
e658b4759a
commit
465c1f9f9e
7 files changed
+26
-26
No files matched your search
@@ -287,17 +287,17 @@ const getMonitorById = async (monitorId) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* Get monitors by UserID
|
||||
* Get monitors by TeamID
|
||||
* @async
|
||||
* @param {Express.Request} req
|
||||
* @param {Express.Response} res
|
||||
* @returns {Promise<Array<Monitor>>}
|
||||
* @throws {Error}
|
||||
*/
|
||||
const getMonitorsByUserId = async (req, res) => {
|
||||
const getMonitorsByTeamId = async (req, res) => {
|
||||
try {
|
||||
let { limit, type, status, sortOrder, normalize } = req.query || {};
|
||||
const monitorQuery = { userId: req.params.userId };
|
||||
const monitorQuery = { teamId: req.params.teamId };
|
||||
|
||||
if (type !== undefined) {
|
||||
const types = Array.isArray(type) ? type : [type];
|
||||
@@ -453,7 +453,7 @@ module.exports = {
|
||||
getAllMonitors,
|
||||
getMonitorStatsById,
|
||||
getMonitorById,
|
||||
getMonitorsByUserId,
|
||||
getMonitorsByTeamId,
|
||||
createMonitor,
|
||||
deleteMonitor,
|
||||
deleteAllMonitors,
|
||||
|
||||
Reference in new issue
Block a user