export type AccountConfig = {id?: number | undefined, company_id: number, account_id?: number | undefined, accounttype_id?: number | undefined, paymentmethod_id?: number | undefined, currency_id?: number | undefined, any_currency?: boolean | undefined, created_at?: string | undefined, updated_at?: string | undefined}; export type UpdateApiApiV1GwAccountconfigsIdArgs = {id: number, body: AccountConfig}; export type UpdateApiApiV1GwAccountconfigsIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Configuración de cuentas - Actualizar * * PUT /api/v1/gw/accountconfigs/{id} */ export const updateApiApiV1GwAccountconfigsId = async (args: UpdateApiApiV1GwAccountconfigsIdArgs, options: UpdateApiApiV1GwAccountconfigsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/gw/accountconfigs/${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 undefined };