export type ManagedUserVM = {acceptor?: boolean | undefined, activated?: boolean | undefined, authorities?: Array | undefined, captchaToken?: string | undefined, clubCode?: number | undefined, clubType?: ('AYRIA' | 'PERSEPOLIS' | 'KARAFARIN' | 'BIMEHKHAVARMIYANE') | undefined, createdBy?: string | undefined, createdDate?: string | undefined, email?: string | undefined, firstName?: string | undefined, gender?: ('MALE' | 'FEMALE') | undefined, id?: number | undefined, imageUrl?: string | undefined, langKey?: string | undefined, lastModifiedBy?: string | undefined, lastModifiedDate?: string | undefined, lastName?: string | undefined, locked?: boolean | undefined, login?: string | undefined, mobile?: string | undefined, nickname?: string | undefined, password: string, plan?: ('BASIC' | 'GOLD' | 'STAR' | 'GALAXY') | undefined}; export type CreateApiApiRegisterArgs = {body: ManagedUserVM}; export type CreateApiApiRegisterOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * registerAccount * * POST /api/register */ export const createApiApiRegister = async (args: CreateApiApiRegisterArgs, options: CreateApiApiRegisterOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/register${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 };