I have the following method:
getData(id){
this.$store.dispatch('getData', {
employeeId: this.employeeId
}).then(() => {
if (this.employeeData.length) {
// here some code...
}
});
},
selectEmployee(d) {
this.getData(d.employeeId);
// I need to execute this only after getData has been processed...
this.$store.dispatch('fetchHistory');
},
So what I would like to do is something like this:
selectEmployee(d) {
this.getData(d.employeeId).then(() => {
// check data here and then execute the fetch
this.$store.dispatch('fetchHistory');
});
},
But I get error in the then secuence, seems is not allowed there.
Any clue?
getData