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