Answer the question
In order to leave comments, you need to log in
How to execute actions in method on successful/failed request from actions vuex?
The bottom line is that I have a request in vuex, when the server responds, I need to call izitoaster (popup with info everything is ok or not), as I was told from vuex itself, it cannot be called, so I need to somehow call izitoast from the component method using a promise where the action is called. Tell me how to do it?
here in vuex:
setEditNewGroup(context, formGroupData) {
HTTP.post(Routes.saveGroupNewEdit, formGroupData)
.then(({ data }) => {
console.log(formGroupData)
// if (!formGroupData.id){
context.commit('getNewAddGroup', {
data: data,
formGroupData: formGroupData
})
// }
})
.catch(error => {
// this.$toast.error('Ошибка загрузки данных. Попробуйте ещё раз')
console.error(error);
})
}
handleSaveGroup(){
this.$store.dispatch('administration/setEditNewGroup', this.formGroupData)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question