* 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
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
|
||||
import request from '../request';
|
||||
|
||||
/**
|
||||
* Lookup an airport from the server
|
||||
*
|
||||
@@ -5,12 +8,12 @@
|
||||
* @param {String} toICAO
|
||||
*/
|
||||
export default async (fromICAO, toICAO) => {
|
||||
let params = {
|
||||
method: 'GET',
|
||||
url: '/api/airports/' + fromICAO + '/distance/' + toICAO,
|
||||
};
|
||||
const params = {
|
||||
method: 'GET',
|
||||
url: `/api/airports/${fromICAO}/distance/${toICAO}`,
|
||||
};
|
||||
|
||||
const response = await axios(params);
|
||||
console.log('distance raw response: ', response);
|
||||
return response.data;
|
||||
const response = await request(params);
|
||||
console.log('distance raw response: ', response);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user