phpvms/resources/js/admin/calculate_distance.js
Nabeel S 0d1f38cf85
Refactor all JS API calls #360 (#375)
* 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
2019-08-30 08:08:00 -04:00

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;
};