export type AdminModifyProductRequest = {env_desc?: string | undefined, env_icon?: string | undefined, env_ttl?: string | undefined, id_proj?: number | undefined, img_bg_prod?: string | undefined, img_mobile_bg_prod?: string | undefined, img_thumbnail_prod?: string | undefined, minimum_buy_vol?: number | undefined, productDetailImageUrls?: Array | undefined, productNameEn?: string | undefined, productNameKr?: string | undefined, productStoryEn?: string | undefined, productStoryKo?: string | undefined, status_srv?: ('ACTIVE' | 'DELETED' | 'INACTIVE' | 'READY') | undefined, unit_price?: number | undefined}; export type UpdateApiBapiV1ProductIdArgs = {id: string, body: AdminModifyProductRequest}; export type UpdateApiBapiV1ProductIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * product 수정 * * PUT /bapi/v1/product/{id} */ export const updateApiBapiV1ProductId = async (args: UpdateApiBapiV1ProductIdArgs, options?: UpdateApiBapiV1ProductIdOptions) => { 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/${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() };