0d1f38cf85
* Refactor all JS API calls #360 * Remove unused imports * Lint JS * Fix doubled api key * Formatting * Added extra logging to distance lookup * Remove the .editorconfig file in distrib * shell check fixes * Remove the .editorconfig file in distrib
20 lines
405 B
JavaScript
20 lines
405 B
JavaScript
|
|
import request from '../request';
|
|
|
|
/**
|
|
* Lookup an airport from the server
|
|
*
|
|
* @param {String} fromICAO
|
|
* @param {String} toICAO
|
|
*/
|
|
export default async (fromICAO, toICAO) => {
|
|
const params = {
|
|
method: 'GET',
|
|
url: `/api/airports/${fromICAO}/distance/${toICAO}`,
|
|
};
|
|
|
|
const response = await request(params);
|
|
console.log('distance raw response: ', response);
|
|
return response.data;
|
|
};
|