export type DeleteApiApiV1CartsCustomerIdItemsItemIdArgs = {customerId: string, itemId: string}; export type DeleteApiApiV1CartsCustomerIdItemsItemIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete the item from shopping cart * * DELETE /api/v1/carts/{customerId}/items/{itemId} */ export const deleteApiApiV1CartsCustomerIdItemsItemId = async (args: DeleteApiApiV1CartsCustomerIdItemsItemIdArgs, options?: DeleteApiApiV1CartsCustomerIdItemsItemIdOptions) => { const {baseUrl = "https://ecommerce.swagger.io/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/carts/${encodeURIComponent(String(args.customerId))}/items/${encodeURIComponent(String(args.itemId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };