fix: updating code to the coding standards & changing the search param
This commit is contained in:
1 parent
800fd4792d
commit
e366741aa9
9 files changed
+9
-127
No files matched your search
@@ -510,7 +510,7 @@ const getMonitorById = async (monitorId) => {
|
||||
};
|
||||
|
||||
const getMonitorsByTeamId = async (req) => {
|
||||
let { limit, type, page, rowsPerPage, filter, field, order, search } = req.query;
|
||||
let { limit, type, page, rowsPerPage, filter, field, order } = req.query;
|
||||
limit = parseInt(limit);
|
||||
page = parseInt(page);
|
||||
rowsPerPage = parseInt(rowsPerPage);
|
||||
@@ -523,8 +523,8 @@ const getMonitorsByTeamId = async (req) => {
|
||||
if (type !== undefined) {
|
||||
matchStage.type = Array.isArray(type) ? { $in: type } : type;
|
||||
}
|
||||
if (search) {
|
||||
matchStage.name = { $regex: search, $options: "i" };
|
||||
if (field === undefined) {
|
||||
matchStage.name = { $regex: filter, $options: "i" };
|
||||
}
|
||||
|
||||
const summaryResult = await Monitor.aggregate(
|
||||
|
||||
Reference in new issue
Block a user