bring over code challenge
This commit is contained in:
commit
76b596da09
20 changed files with 51221 additions and 0 deletions
10
models/airport.ts
Normal file
10
models/airport.ts
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue