export type AddHomeProductRequest = {order?: number | undefined}; export type CreateApiBapiV1ProductHomeIdArgs = {id: string, body: AddHomeProductRequest}; export type CreateApiBapiV1ProductHomeIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Home Products 에 Product 추가 * * POST /bapi/v1/product/home/{id} */ export const createApiBapiV1ProductHomeId = async (args: CreateApiBapiV1ProductHomeIdArgs, options?: CreateApiBapiV1ProductHomeIdOptions) => { 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: "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() };