[Vuejs]-Vue.js – response data error undefined

2πŸ‘

βœ…

yes error response was 404 so there is not error attribute in response so you can not add it to if condition.

so to next time if you want to debug it you can use console

.catch(error => {
    this.errors = [];
    // you can debug it
    console.log(error);
 });

example

// this will come from the ajax
var error = {
   data :{
     'error' : 'some data we can see it in console'
   }   
}

console.log(error);

0πŸ‘

Answer:

Problem was with the incorrect route path:

axios.post('/roster'
πŸ‘€tomczas

Leave a comment