remove teamId from uptime monitor requests
This commit is contained in:
1 parent
134e547736
commit
d9c2f31f4e
5 files changed
+16
-66
No files matched your search
@@ -135,36 +135,6 @@ class NetworkService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* ************************************
|
||||
* Gets monitors and summary of stats by TeamID
|
||||
* ************************************
|
||||
*
|
||||
* @async
|
||||
* @param {Object} config - The configuration object.
|
||||
* @param {string} config.teamId - Team ID
|
||||
* @param {Array<string>} config.types - Array of monitor types
|
||||
* @returns {Promise<AxiosResponse>} The response from the axios POST request.
|
||||
*/
|
||||
async getMonitorsSummaryByTeamId(config) {
|
||||
const params = new URLSearchParams();
|
||||
|
||||
if (config.types) {
|
||||
config.types.forEach((type) => {
|
||||
params.append("type", type);
|
||||
});
|
||||
}
|
||||
return this.axiosInstance.get(
|
||||
`/monitors/team/summary/${config.teamId}?${params.toString()}`,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ************************************
|
||||
* Get all uptime monitors for a Team
|
||||
@@ -184,7 +154,7 @@ class NetworkService {
|
||||
*/
|
||||
|
||||
async getMonitorsByTeamId(config) {
|
||||
const { teamId, limit, types, page, rowsPerPage, filter, field, order } = config;
|
||||
const { limit, types, page, rowsPerPage, filter, field, order } = config;
|
||||
const params = new URLSearchParams();
|
||||
|
||||
if (limit) params.append("limit", limit);
|
||||
@@ -199,7 +169,7 @@ class NetworkService {
|
||||
if (field) params.append("field", field);
|
||||
if (order) params.append("order", order);
|
||||
|
||||
return this.axiosInstance.get(`/monitors/team/${teamId}?${params.toString()}`, {
|
||||
return this.axiosInstance.get(`/monitors/team?${params.toString()}`, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
@@ -949,7 +919,7 @@ class NetworkService {
|
||||
// Fetch monitors with summary by TeamID
|
||||
// ************************************
|
||||
async getMonitorsWithSummaryByTeamId(config) {
|
||||
const { teamId, types } = config;
|
||||
const { types } = config;
|
||||
const params = new URLSearchParams();
|
||||
|
||||
if (types) {
|
||||
@@ -958,21 +928,18 @@ class NetworkService {
|
||||
});
|
||||
}
|
||||
|
||||
return this.axiosInstance.get(
|
||||
`/monitors/summary/team/${teamId}?${params.toString()}`,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
return this.axiosInstance.get(`/monitors/summary/team?${params.toString()}`, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// ************************************
|
||||
// Fetch monitors with checks by TeamID
|
||||
// ************************************
|
||||
async getMonitorsWithChecksByTeamId(config) {
|
||||
const { teamId, limit, types, page, rowsPerPage, filter, field, order } = config;
|
||||
const { limit, types, page, rowsPerPage, filter, field, order } = config;
|
||||
const params = new URLSearchParams();
|
||||
|
||||
if (limit) params.append("limit", limit);
|
||||
@@ -987,14 +954,11 @@ class NetworkService {
|
||||
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",
|
||||
},
|
||||
}
|
||||
);
|
||||
return this.axiosInstance.get(`/monitors/team/with-checks?${params.toString()}`, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// ************************************
|
||||
|
||||
Reference in new issue
Block a user