Updated default limit for airports

This commit is contained in:
2025-04-13 23:09:36 -04:00
parent 592de030c8
commit 977bb85cb3
2 changed files with 4 additions and 1 deletions

1
.env
View File

@@ -35,6 +35,7 @@ SSL_CERT_PATH=../ssl/localhost.crt
SSL_CERT_KEY_PATH=../ssl/localhost.key
VITE_API_URL=${NGINX_PROTOCOL}://${NGINX_HOST}:${NGINX_HTTP_PORT}/api
VITE_DEFAULT_LIMIT=200
__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS:${NGINX_HOST}
ENVIRONMENT=development

View File

@@ -1,6 +1,8 @@
import { Airport, AirportCategory, Bounds, GetAirportsResponse } from '@lib/airport.types.ts';
import { getRequest } from '@lib/index.ts';
const defaultLimit = import.meta.env.VITE_DEFAULT_LIMIT || 150;
export async function getAirport({ icao }: { icao: string }): Promise<Airport> {
const response = await getRequest(`airports/${icao}`);
return response?.json() || {};
@@ -22,7 +24,7 @@ export async function getAirports({
categories,
bounds,
metars = false,
limit = 1000,
limit = defaultLimit,
page = 1
}: GetAirportsParameters): Promise<GetAirportsResponse> {
const response = await getRequest('airports', {