In my vue component I have a data array
data: {
categories: [{id:1, title: "category 1"},{id:2, title: "category 2"}]
}
and I’m trying to load this in as a data argument in an axios call
axios({
method: 'get',
url: //testURL,
data: {
categoryCall: this.categories
}
}).then(function (response){
console.log(response);
}).catch(function (error){
console.log(error.response);
});
but I’m getting a 400 bad request code where it tells me that argument 1 should be an array and null is given.
Am I not properly passing in the already established array in the axios call? Where am I going wrong?