fix: updating code to the coding standards & changing the search param

This commit is contained in:
Amol committed 2025-06-14 23:49:39 +05:30
1 parent 800fd4792d
commit e366741aa9
9 files changed
+9 -127

No files matched your search

+3 -3
View File
@@ -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(