Check the monitor URL resolution before adding it

This commit is contained in:
om-3004 committed 2024-10-15 17:20:54 +05:30
1 parent 4a1b290416
commit ebf6a0ceb7
5 files changed
+161 -50

No files matched your search

+26
View File
@@ -89,6 +89,32 @@ class NetworkService {
});
}
/**
*
* ************************************
* Check the endpoint resolution
* ************************************
*
* @async
* @param {Object} config - The configuration object.
* @param {string} config.authToken - The authorization token to be used in the request header.
* @param {Object} config.monitorURL - The monitor url to be sent in the request body.
* @returns {Promise<AxiosResponse>} The response from the axios POST request.
*/
async checkEndpointResolution(config) {
const { authToken, monitorURL } = config;
const params = new URLSearchParams();
if (monitorURL) params.append("monitorURL", monitorURL);
return this.axiosInstance.get(`/monitors/check-endpoint/url?${params.toString()}`, {
headers: {
Authorization: `Bearer ${authToken}`,
"Content-Type": "application/json",
}
})
}
/**
*
* ************************************