Set the baseURL for ajax requests (#373)

* Set the baseURL for ajax requests

* Use async/await on AJAX calls

* Add mix_public() cache generated asset cache busting

* Move storage container into separate class

* Fix some styling
This commit is contained in:
Nabeel S
2019-08-27 15:08:42 -04:00
committed by GitHub
parent fd2f4f2150
commit 09f3e3cfdf
16 changed files with 335 additions and 145 deletions
+8 -9
View File
@@ -1,18 +1,17 @@
'use strict';
/**
* Lookup an airport from the server
* @param icao
* @param callback
*
* @param {String} icao
*/
export default (icao, callback) => {
export default async (icao) => {
let params = {
method: 'GET',
url: '/api/airports/' + icao + '/lookup',
};
console.log('Looking airport up');
axios(params)
.then(response => {
console.log(response);
callback(response.data);
});
const response = await axios(params);
console.log('lookup raw response: ', response);
return response.data;
};