axios+telemetry cleanup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import axios from 'axios'
|
||||
import { getOauthConfig } from '../../constants/oauth.js'
|
||||
import { getOAuthHeaders, prepareApiRequest } from '../../utils/teleport/api.js'
|
||||
import { nativeRequest } from '../../utils/http.js'
|
||||
|
||||
export type AdminRequestType = 'limit_increase' | 'seat_upgrade'
|
||||
|
||||
@@ -58,7 +58,11 @@ export async function createAdminRequest(
|
||||
|
||||
const url = `${getOauthConfig().BASE_API_URL}/api/oauth/organizations/${orgUUID}/admin_requests`
|
||||
|
||||
const response = await axios.post<AdminRequest>(url, params, { headers })
|
||||
const response = await nativeRequest<AdminRequest>(url, {
|
||||
method: 'POST',
|
||||
body: params,
|
||||
headers,
|
||||
})
|
||||
|
||||
return response.data
|
||||
}
|
||||
@@ -84,7 +88,8 @@ export async function getMyAdminRequests(
|
||||
url += `&statuses=${status}`
|
||||
}
|
||||
|
||||
const response = await axios.get<AdminRequest[] | null>(url, {
|
||||
const response = await nativeRequest<AdminRequest[] | null>(url, {
|
||||
method: 'GET',
|
||||
headers,
|
||||
})
|
||||
|
||||
@@ -111,7 +116,8 @@ export async function checkAdminRequestEligibility(
|
||||
|
||||
const url = `${getOauthConfig().BASE_API_URL}/api/oauth/organizations/${orgUUID}/admin_requests/eligibility?request_type=${requestType}`
|
||||
|
||||
const response = await axios.get<AdminRequestEligibilityResponse>(url, {
|
||||
const response = await nativeRequest<AdminRequestEligibilityResponse>(url, {
|
||||
method: 'GET',
|
||||
headers,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user