export type AltaAmenidadReservacionRequest = {acepto?: string | undefined, codigo?: string | undefined, estatus?: string | undefined, fecha?: string | undefined, idAmenidad?: number | undefined, idUsuario?: number | undefined, idinmueble?: number | undefined}; export type UpdateApiApiReservacionAmenidadIdReservacionArgs = {id_reservacion: number, body: AltaAmenidadReservacionRequest}; export type UpdateApiApiReservacionAmenidadIdReservacionOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * actualiza_reservacion * * PUT /api/reservacion/amenidad/{id_reservacion} */ export const updateApiApiReservacionAmenidadIdReservacion = async (args: UpdateApiApiReservacionAmenidadIdReservacionArgs, options: UpdateApiApiReservacionAmenidadIdReservacionOptions) => { 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/reservacion/amenidad/${encodeURIComponent(String(args.id_reservacion))}${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() };