refactor networkSerivce.getMonitorsByTeamId to take a config objet

This commit is contained in:
Alex Holliday committed 2024-09-18 10:57:44 +08:00
1 parent cab023709b
commit 4748afb93a
5 files changed
+74 -58

No files matched your search

+4 -2
View File
@@ -359,8 +359,10 @@ const getMonitorsByTeamId = async (req, res) => {
field,
order,
} = req.query || {};
const monitorQuery = { teamId: req.params.teamId, type };
const monitorQuery = { teamId: req.params.teamId };
if (type !== undefined) {
monitorQuery.type = type;
}
// Add filter if provided
// $options: "i" makes the search case-insensitive
if (filter !== undefined) {