update network service to handle all monitors properly
This commit is contained in:
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,
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user