export type UpdateApiCustomerProfileUpdatesIdArgs = {id: string, 'X-STOREFRONT-KEY': string, 'X-Locale'?: string | undefined, 'X-Channel'?: string | undefined, 'X-Currency'?: string | undefined, body: {firstName?: string | undefined, lastName?: string | undefined, email?: string | undefined, phone?: string | undefined, gender?: ('Male' | 'Female' | 'Other') | undefined, dateOfBirth?: string | undefined, currentPassword?: string | undefined, password?: string | undefined, confirmPassword?: string | undefined, subscribedToNewsLetter?: boolean | undefined, image?: string | undefined, deleteImage?: boolean | undefined}}; export type UpdateApiCustomerProfileUpdatesIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update customer profile * * PUT /customer-profile-updates/{id} */ export const updateApiCustomerProfileUpdatesId = async (args: UpdateApiCustomerProfileUpdatesIdArgs, options?: UpdateApiCustomerProfileUpdatesIdOptions) => { const {baseUrl = "http://localhost:8000/api/shop", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") 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(/\/+$/, '')}/customer-profile-updates/${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 (await res.json()) as unknown };