export type ClubDTO = {code?: number | undefined, description?: string | undefined, discount?: number | undefined, enabled?: boolean | undefined, id?: number | undefined, name: string, ownerMobile?: string | undefined, ownerName?: string | undefined, owneraCode?: string | undefined, owneraName?: string | undefined, theme?: string | undefined, type?: ('AYRIA' | 'PERSEPOLIS' | 'KARAFARIN' | 'BIMEHKHAVARMIYANE') | undefined, voucher?: number | undefined}; export type UpdateApiApiClubsArgs = {body: ClubDTO}; export type UpdateApiApiClubsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * updateClub * * PUT /api/clubs */ export const updateApiApiClubs = async (args: UpdateApiApiClubsArgs, options: UpdateApiApiClubsOptions) => { 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/clubs${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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() };