add network util method to submit form

This commit is contained in:
Alex Holliday committed 2024-10-04 12:39:52 +08:00
1 parent 8e87bdccd0
commit f5547a1825
3 files changed
+38 -3

No files matched your search

+26
View File
@@ -683,6 +683,32 @@ class NetworkService {
},
});
}
/**
* ************************************
* Creates a maintenance window
* ************************************
*
* @async
* @param {Object} config - The configuration object.
* @param {string} config.authToken - The authorization token to be used in the request header.
* @param {Object} config.maintenanceWindow - The maintenance window object to be sent in the request body.
* @returns {Promise<AxiosResponse>} The response from the axios POST request.
*
*/
async createMaintenanceWindow(config) {
return this.axiosInstance.post(
`/maintenance-window`,
config.maintenanceWindow,
{
headers: {
Authorization: `Bearer ${config.authToken}`,
"Content-Type": "application/json",
},
}
);
}
}
export default NetworkService;