export type AltaAmenidadesCaracteristicasRequest = {accesgroup?: number | undefined, capacidadMaxima?: number | undefined, cluster?: string | undefined, descripcion?: string | undefined, imagen?: string | undefined, nombre?: string | undefined, precio?: number | undefined}; export type UpdateApiApiAmenidadIdAmenidadArgs = {id_amenidad: number, body: AltaAmenidadesCaracteristicasRequest}; export type UpdateApiApiAmenidadIdAmenidadOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * actualiza * * PUT /api/amenidad/{id_amenidad} */ export const updateApiApiAmenidadIdAmenidad = async (args: UpdateApiApiAmenidadIdAmenidadArgs, options: UpdateApiApiAmenidadIdAmenidadOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/amenidad/${encodeURIComponent(String(args.id_amenidad))}${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 res.blob() };