I have a vue component with 2 methods, deleteActivitat calls an axios.get method and then, this calls the other vue method reloadActivitats:
methods: {
reloadActivitats: function () {
this.$store.dispatch(actionTypes.FETCH_ACTIVITATS)
},
deleteActivitat: (activitat) => {
crud.delete(activitat).then((response) => {
this.reloadActivitats() // calls reloadActivitats method
}).catch((error) => {
console.log(error);
});
}
}
But when I run the application the reloadActivitats method is not executed and the console shows the next error:
TypeError: _this.reloadActivitats is not a function
Any idea of what I'm doing wrong?