bbec276da8
* #355 Calculate distance button in add/edit Flight page * Styling * Move add/edit flight logic out of controller and into service layer * Styling * Formatting * Run styleci against modules dir * Styleci config * Style fixes in /modules
20 lines
446 B
JavaScript
20 lines
446 B
JavaScript
/**
|
|
* Lookup an airport from the server
|
|
* @param fromICAO
|
|
* @param toICAO
|
|
* @param callback
|
|
*/
|
|
export default (fromICAO, toICAO, callback) => {
|
|
let params = {
|
|
method: 'GET',
|
|
url: '/api/airports/' + fromICAO + '/distance/' + toICAO,
|
|
};
|
|
|
|
console.log('Calcuating airport distance');
|
|
axios(params)
|
|
.then(response => {
|
|
console.log(response);
|
|
callback(response.data);
|
|
});
|
|
};
|