export type CreateApiOrganizationRequestTransferArgs = {body: {organization: {transfer_to_id?: number | undefined, transfer_to_email?: string | undefined}}}; export type CreateApiOrganizationRequestTransferOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Request transfer * * POST /organization/request_transfer */ export const createApiOrganizationRequestTransfer = async (args: CreateApiOrganizationRequestTransferArgs, options?: CreateApiOrganizationRequestTransferOptions) => { const {baseUrl = "https://api.kisi.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/organization/request_transfer${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };