I want to execute function2 after axios. I got no catch error. but still Function2 is not executed.
The code i want but not working :
add: function () {
axios.post('/add', this.person)
.then(response => {
if (response.data.etat) {
this.person = {};
this.function2();
}
})
.catch(error => {
console.log('errors: ', error)
})},
This is working, but i would like to execute function2 only if axios pass.
add: function () {
axios.post('/add', this.person)
.then(response => {
if (response.data.etat) {
this.person = {};
}
})
.catch(error => {
console.log('errors: ', error)
})
this.function2();
},
Any help ? thank you !