MCPcopy Create free account
hub / github.com/Noumena-Network/code / createAdminRequest

Function createAdminRequest

src/services/api/adminRequests.ts:49–66  ·  view source on GitHub ↗
(
  params: AdminRequestCreateParams,
)

Source from the content-addressed store, hash-verified

47 * returns the existing request instead of creating a new one.
48 */
49export async function createAdminRequest(
50 params: AdminRequestCreateParams,
51): Promise<AdminRequest> {
52 const { accessToken, orgUUID } = await prepareApiRequest()
53
54 const headers = {
55 ...getOAuthHeaders(accessToken),
56 'x-organization-uuid': orgUUID,
57 }
58
59 const url = buildNoumenaPlatformUrl(
60 `/api/oauth/organizations/${orgUUID}/admin_requests`,
61 )
62
63 const response = await axios.post<AdminRequest>(url, params, { headers })
64
65 return response.data
66}
67
68/**
69 * Get pending admin request of a specific type for the current user.

Callers 1

runExtraUsageFunction · 0.85

Calls 3

prepareApiRequestFunction · 0.85
getOAuthHeadersFunction · 0.85
buildNoumenaPlatformUrlFunction · 0.85

Tested by

no test coverage detected