From 91741c2ae51341b3076b5144d3a70150ab664d48 Mon Sep 17 00:00:00 2001 From: Amol Date: Sun, 15 Jun 2025 03:17:22 +0530 Subject: [PATCH] fix: removing unused code blocks and better handling for filter param --- client/src/Pages/Infrastructure/Monitors/index.jsx | 2 +- client/src/Utils/NetworkService.js | 1 - server/db/mongo/modules/monitorModule.js | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/client/src/Pages/Infrastructure/Monitors/index.jsx b/client/src/Pages/Infrastructure/Monitors/index.jsx index 2f146f2de..445ba8105 100644 --- a/client/src/Pages/Infrastructure/Monitors/index.jsx +++ b/client/src/Pages/Infrastructure/Monitors/index.jsx @@ -56,7 +56,7 @@ const InfrastructureMonitors = () => { const { monitors, summary, isLoading, networkError } = useMonitorFetch({ page, field: field, - filter: toFilterStatus || search, + filter: toFilterStatus ?? search, rowsPerPage, updateTrigger, }); diff --git a/client/src/Utils/NetworkService.js b/client/src/Utils/NetworkService.js index 27964a5ef..3d124a3e6 100644 --- a/client/src/Utils/NetworkService.js +++ b/client/src/Utils/NetworkService.js @@ -182,7 +182,6 @@ class NetworkService { * @param {string} [config.filter] - The filter to apply to the monitors. * @param {string} [config.field] - The field to sort by. * @param {string} [config.order] - The order in which to sort the field. - * @param {string} [config.search] - The search term to filter monitors by name. * @returns {Promise} The response from the axios GET request. */ diff --git a/server/db/mongo/modules/monitorModule.js b/server/db/mongo/modules/monitorModule.js index 735cb6cc5..3d9adab39 100755 --- a/server/db/mongo/modules/monitorModule.js +++ b/server/db/mongo/modules/monitorModule.js @@ -523,9 +523,6 @@ const getMonitorsByTeamId = async (req) => { if (type !== undefined) { matchStage.type = Array.isArray(type) ? { $in: type } : type; } - if (field === undefined) { - matchStage.name = { $regex: filter, $options: "i" }; - } const summaryResult = await Monitor.aggregate( buildMonitorSummaryByTeamIdPipeline({ matchStage })