export type AltaVehiculosRequest = {acepto?: string | undefined, anio?: string | undefined, color?: string | undefined, documento?: string | undefined, estatus?: string | undefined, idUsuario?: number | undefined, idVehiculo?: number | undefined, inmueble?: number | undefined, marca?: string | undefined, modelo?: string | undefined, niveles?: string | undefined, notas?: string | undefined, placas?: string | undefined, propietario?: string | undefined, qr?: string | undefined, tarjeta?: string | undefined, tipo?: string | undefined, tipov?: string | undefined}; export type CreateApiApiNuevoVehiculoArgs = {body: AltaVehiculosRequest}; export type CreateApiApiNuevoVehiculoOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Agrega nuevos vehiculos * * POST /api/nuevoVehiculo */ export const createApiApiNuevoVehiculo = async (args: CreateApiApiNuevoVehiculoArgs, options: CreateApiApiNuevoVehiculoOptions) => { 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/nuevoVehiculo${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() };