export type DeleteApiWishlistsIdArgs = {id: string, 'X-STOREFRONT-KEY': string, 'X-Locale'?: string | undefined, 'X-Channel'?: string | undefined, 'X-Currency'?: string | undefined}; export type DeleteApiWishlistsIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove a wishlist item * * DELETE /wishlists/{id} */ export const deleteApiWishlistsId = async (args: DeleteApiWishlistsIdArgs, options?: DeleteApiWishlistsIdOptions) => { const {baseUrl = "http://localhost:8000/api/shop", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-STOREFRONT-KEY'] != null) headers.set("X-STOREFRONT-KEY", String(args['X-STOREFRONT-KEY'])) if (args['X-Locale'] != null) headers.set("X-Locale", String(args['X-Locale'])) if (args['X-Channel'] != null) headers.set("X-Channel", String(args['X-Channel'])) if (args['X-Currency'] != null) headers.set("X-Currency", String(args['X-Currency'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/wishlists/${encodeURIComponent(String(args.id))}${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 };