export type Ostan = {amarCode: number, id?: number | undefined, name: string, phoneCode?: string | undefined}; export type User = {activated: boolean, clubCardNumber?: number | undefined, clubCode?: number | undefined, clubType?: ('AYRIA' | 'PERSEPOLIS' | 'KARAFARIN' | 'BIMEHKHAVARMIYANE') | undefined, email?: string | undefined, firstName?: string | undefined, fullname?: string | undefined, gender?: ('MALE' | 'FEMALE') | undefined, id?: number | undefined, imageUrl?: string | undefined, langKey?: string | undefined, lastName?: string | undefined, locked?: boolean | undefined, login: string, mobile?: string | undefined, nickname?: string | undefined, notSystem?: boolean | undefined, originClubCode?: number | undefined, persepolisi?: boolean | undefined, plan?: ('BASIC' | 'GOLD' | 'STAR' | 'GALAXY') | undefined, system?: boolean | undefined}; export type Ostanban = {id?: number | undefined, ostan: Ostan, user: User}; export type CreateApiApiOstanbansArgs = {body: Ostanban}; export type CreateApiApiOstanbansOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * createOstanban * * POST /api/ostanbans */ export const createApiApiOstanbans = async (args: CreateApiApiOstanbansArgs, options: CreateApiApiOstanbansOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/ostanbans${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 res.blob() };