I need to set my JSON to variable because I am using it in 2 places, the
let data = {
"test": "hello",
"test2": "hello2
}
axios.post('/route', {
data
})
.then((response) => {
this.$emit('anotherFunction', data);
})
I get a 400 back and then when I inspect the network request, the payload is: "{data: {"test": "hello", "test2": "hello2"}}" which makes sense but how can I have the JSON without the data part of it?