fetchBudget whenever current budget changes

This commit is contained in:
Jan Bader 2022-01-25 08:55:54 +00:00
parent 59ae9f978a
commit 339c230756
2 changed files with 7 additions and 1 deletions

View File

@ -54,7 +54,6 @@ const dashboard = {
commit("setCurrentBudget", element); commit("setCurrentBudget", element);
break break
} }
await dispatch("fetchBudget", budgetid);
} }
} }
} }

View File

@ -38,6 +38,13 @@ const store = createStore({
} }
}) })
store.subscribe((mutation, state) => {
if(mutation.type == "setCurrentBudget"){
console.log(mutation, state);
store.dispatch("fetchBudget", mutation.payload.ID)
}
})
store.subscribe((mutation, state) => { store.subscribe((mutation, state) => {
let persistedState = { let persistedState = {
Session: state.Session, Session: state.Session,