update network service to handle all monitors properly

This commit is contained in:
Vishnu Sreekumaran Nair committed 2025-03-15 01:38:52 -04:00
1 parent f4e56008df
commit c07f68dfb1
2 files changed
+5 -4

No files matched your search

@@ -103,7 +103,8 @@ export const updateInfrastructureMonitor = createAsyncThunk(
description: monitor.description,
interval: monitor.interval,
notifications: monitor.notifications,
threshold: monitor.threshold,
thresholds: monitor.thresholds,
secret: monitor.secret,
};
const res = await networkService.updateMonitor({
monitorId,
+3 -3
View File
@@ -257,14 +257,14 @@ class NetworkService {
* @returns {Promise<AxiosResponse>} The response from the axios PUT request.
*/
async updateMonitor(config) {
const { monitorId, monitor } = config;
const updatedFields = {
const { monitorId, monitor, updatedFields } = config;
const payload = updatedFields ?? {
name: monitor.name,
description: monitor.description,
interval: monitor.interval,
notifications: monitor.notifications,
};
return this.axiosInstance.put(`/monitors/${monitorId}`, updatedFields, {
return this.axiosInstance.put(`/monitors/${monitorId}`, payload, {
headers: {
"Content-Type": "application/json",
},