export type UpdateHomeProductRequest = {order?: number | undefined}; export type UpdateApiBapiV1ProductHomeIdArgs = {id: string, body: UpdateHomeProductRequest}; export type UpdateApiBapiV1ProductHomeIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Home Product Order * * PUT /bapi/v1/product/home/{id} */ export const updateApiBapiV1ProductHomeId = async (args: UpdateApiBapiV1ProductHomeIdArgs, options?: UpdateApiBapiV1ProductHomeIdOptions) => { const {baseUrl = "https://api.wincl.io:443", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/bapi/v1/product/home/${encodeURIComponent(String(args.id))}${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() };