Overhaul refactor. Still things in progress
This commit is contained in:
11
ui-old/src/api/metar.ts
Normal file
11
ui-old/src/api/metar.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Metar } from './metar.types';
|
||||
import { getRequest } from '.';
|
||||
|
||||
export async function getMetars(icaos: string[]): Promise<Metar[]> {
|
||||
if (icaos.length == 0) {
|
||||
return [];
|
||||
}
|
||||
const stationICAOs: string = icaos.map((icao) => icao).join(',');
|
||||
const response = await getRequest(`metars`, { icaos: stationICAOs });
|
||||
return response?.json() || [];
|
||||
}
|
||||
Reference in New Issue
Block a user