( requestType: AdminRequestType, )
| 100 | * Check if a specific admin request type is allowed for this org. |
| 101 | */ |
| 102 | export async function checkAdminRequestEligibility( |
| 103 | requestType: AdminRequestType, |
| 104 | ): Promise<AdminRequestEligibilityResponse | null> { |
| 105 | const { accessToken, orgUUID } = await prepareApiRequest() |
| 106 | |
| 107 | const headers = { |
| 108 | ...getOAuthHeaders(accessToken), |
| 109 | 'x-organization-uuid': orgUUID, |
| 110 | } |
| 111 | |
| 112 | const url = `${getOauthConfig().BASE_API_URL}/api/oauth/organizations/${orgUUID}/admin_requests/eligibility?request_type=${requestType}` |
| 113 | |
| 114 | const response = await axios.get<AdminRequestEligibilityResponse>(url, { |
| 115 | headers, |
| 116 | }) |
| 117 | |
| 118 | return response.data |
| 119 | } |
| 120 |
no test coverage detected