export type UpdateApiApiAcceptorKalaUpdateStockKalaIdOutOfStockArgs = {kalaId: number, outOfStock: boolean}; export type UpdateApiApiAcceptorKalaUpdateStockKalaIdOutOfStockOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * update * * PUT /api/acceptor-kala/update-stock/{kalaId}/{outOfStock} */ export const updateApiApiAcceptorKalaUpdateStockKalaIdOutOfStock = async (args: UpdateApiApiAcceptorKalaUpdateStockKalaIdOutOfStockArgs, options: UpdateApiApiAcceptorKalaUpdateStockKalaIdOutOfStockOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/acceptor-kala/update-stock/${encodeURIComponent(String(args.kalaId))}/${encodeURIComponent(String(args.outOfStock))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };