There seems to be an issue with the axios query function, as it is querying the wrong URL just before sending the query.
getShows : function(){
if( ! this.query ) return false;
var getURL = this.makeUrlFromObject(this.query);
console.log('getURL', getURL);
var self = this;
axios.get(getURL).then(function(response){
console.log('response.data', response.data)
self.shows = response.data;
});
},
makeUrlFromObject : function(query){
var queryArray = [];
for (var prop in query) {
if(!query.hasOwnProperty(prop)) continue;
queryArray.push(prop + "=" + query[prop]);
}
var url = this.apiUrl + '?' + queryArray.join('&');
return url;
},
...
When running the getShows
function, the console displays the following:
1. getURL /api/all?date=20180131
2. GET http://website.dev/shows/false 404 (Not Found) false:1
3. response.data (3) [{…}, {…}, {…}]
The source of the false:1
error is unclear. The request and response are functioning correctly, but an unexpected extra request seems to be triggered.