bring over code challenge

This commit is contained in:
Friedhelm Filler 2021-05-11 20:35:45 +01:00
commit 76b596da09
No known key found for this signature in database
GPG key ID: BA6A6C5B1AC9E30A
20 changed files with 51221 additions and 0 deletions

10
models/airport.ts Normal file
View file

@ -0,0 +1,10 @@
import airports from '../data/airports.json'
import Airport from '../types/airport'
export const findAirportByIata = async (iata: string): Promise<Airport | undefined> => {
return airports.find(airport => airport.iata === iata.toUpperCase())
}
export const allAirports = async (): Promise<Airport[]> => {
return airports
}