export type UpdateApiApiV2AccountsAccountIdImagesArgs = {accountId: string, body: BodyInit}; export type UpdateApiApiV2AccountsAccountIdImagesOptions = {baseUrl?: string | undefined, mms?: string | undefined, fetch?: typeof fetch | undefined}; /** * Upload account image * * PUT /api/v2/accounts/{accountId}/images */ export const updateApiApiV2AccountsAccountIdImages = async (args: UpdateApiApiV2AccountsAccountIdImagesArgs, options?: UpdateApiApiV2AccountsAccountIdImagesOptions) => { const {baseUrl = "https://mms.api.ed.ts.egym.coffee", fetch: fetchFn = fetch, mms} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (mms !== undefined) headers.set("x-api-key", mms) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/accounts/${encodeURIComponent(String(args.accountId))}/images${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };