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 CreateApiApiAmenidadArgs = {body: AltaAmenidadesCaracteristicasRequest}; export type CreateApiApiAmenidadOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Guarda nuevas amenidades con sus caracteristicas * * POST /api/amenidad */ export const createApiApiAmenidad = async (args: CreateApiApiAmenidadArgs, options: CreateApiApiAmenidadOptions) => { 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${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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() };