export type DeleteApiApiOrgsOrgIdMembersUidArgs = {org_id: string, uid: string}; export type DeleteApiApiOrgsOrgIdMembersUidOptions = {baseUrl: string, HTTPBearerJWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove member from organization * * DELETE /api/orgs/{org_id}/members/{uid} */ export const deleteApiApiOrgsOrgIdMembersUid = async (args: DeleteApiApiOrgsOrgIdMembersUidArgs, options: DeleteApiApiOrgsOrgIdMembersUidOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearerJWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearerJWT !== undefined) headers.set('authorization', `Bearer ${HTTPBearerJWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/orgs/${encodeURIComponent(String(args.org_id))}/members/${encodeURIComponent(String(args.uid))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };