export type DeliveryAreaDTO = {acceptorAcceptorName?: string | undefined, acceptorCode?: string | undefined, acceptorId?: number | undefined, id?: number | undefined, name: string, shared?: boolean | undefined}; export type UpdateApiApiDeliveryAreasArgs = {body: DeliveryAreaDTO}; export type UpdateApiApiDeliveryAreasOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * updateDeliveryArea * * PUT /api/delivery-areas */ export const updateApiApiDeliveryAreas = async (args: UpdateApiApiDeliveryAreasArgs, options: UpdateApiApiDeliveryAreasOptions) => { 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/delivery-areas${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() };