2019-08-28 03:08:42 +08:00
|
|
|
'use strict';
|
|
|
|
|
2019-08-27 00:32:46 +08:00
|
|
|
/**
|
|
|
|
* Lookup an airport from the server
|
2019-08-28 03:08:42 +08:00
|
|
|
*
|
|
|
|
* @param {String} icao
|
2019-08-27 00:32:46 +08:00
|
|
|
*/
|
2019-08-28 03:08:42 +08:00
|
|
|
export default async (icao) => {
|
2019-08-27 00:32:46 +08:00
|
|
|
let params = {
|
|
|
|
method: 'GET',
|
|
|
|
url: '/api/airports/' + icao + '/lookup',
|
|
|
|
};
|
|
|
|
|
2019-08-28 03:08:42 +08:00
|
|
|
const response = await axios(params);
|
|
|
|
console.log('lookup raw response: ', response);
|
|
|
|
return response.data;
|
2019-08-27 00:32:46 +08:00
|
|
|
};
|