Updated airport codes

This commit is contained in:
2023-09-11 20:15:30 -04:00
parent 12ed29b016
commit 75ed374e2f
3 changed files with 544813 additions and 1289417 deletions

View File

@@ -3,6 +3,9 @@ import { Airport } from './airport.types';
import { Metar } from './metar.types';
export async function getMetars(airports: Airport[]): Promise<Metar[]> {
if (airports.length == 0) {
return [];
}
const stationICAOs: string = airports.map((airport) => airport.icao).join(',');
const url = `http://localhost:5000/metars/${stationICAOs}`;
const response = await axios.get(url).catch((error) => console.error(error));