From badcf436b6d1cd1f4d673029f7ced79ad8bfe320 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 14 Mar 2025 11:06:10 -0700 Subject: [PATCH] add network op --- src/Utils/NetworkService.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/Utils/NetworkService.js b/src/Utils/NetworkService.js index b27e0cb06..ec8a10abf 100644 --- a/src/Utils/NetworkService.js +++ b/src/Utils/NetworkService.js @@ -1056,6 +1056,35 @@ class NetworkService { } ); } + + // ************************************ + // Fetch monitors with checks by TeamID + // ************************************ + async getMonitorsWithChecksByTeamId(config) { + const { teamId, limit, types, page, rowsPerPage, filter, field, order } = config; + const params = new URLSearchParams(); + + if (limit) params.append("limit", limit); + if (types) { + types.forEach((type) => { + params.append("type", type); + }); + } + if (page) params.append("page", page); + if (rowsPerPage) params.append("rowsPerPage", rowsPerPage); + if (filter) params.append("filter", filter); + if (field) params.append("field", field); + if (order) params.append("order", order); + + return this.axiosInstance.get( + `/monitors/team/${teamId}/with-checks?${params.toString()}`, + { + headers: { + "Content-Type": "application/json", + }, + } + ); + } } export default NetworkService;