export type Image = {thumbnail: string, original: string}; export type Model31 = Array; export type Model32 = {text: string, lang: string}; export type Names = Array; export type Model33 = {categoryID: string, name: string, image?: Image | undefined, tag: string, productTypes?: Model31 | undefined, commission: number, names: Names}; export type UpdateApiBusinessUpdateBusinessCategoryArgs = {'content-language': string, body: Model33}; export type UpdateApiBusinessUpdateBusinessCategoryOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update the data of a business category * * PUT /business/updateBusinessCategory */ export const updateApiBusinessUpdateBusinessCategory = async (args: UpdateApiBusinessUpdateBusinessCategoryArgs, options?: UpdateApiBusinessUpdateBusinessCategoryOptions) => { const {baseUrl = "http://api.pickerexpress.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (args['content-language'] != null) headers.set("content-language", String(args['content-language'])) const url = `${baseUrl.replace(/\/+$/, '')}/business/updateBusinessCategory${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() };