fetchBudget whenever current budget changes

This commit is contained in:
jacob1123 committed 2022-01-25 08:55:54 +00:00
1 parent 59ae9f978a
commit 339c230756
2 files changed
+7 -1

No files matched your search

-1
View File
@@ -54,7 +54,6 @@ const dashboard = {
commit("setCurrentBudget", element); commit("setCurrentBudget", element);
break break
} }
await dispatch("fetchBudget", budgetid);
} }
} }
} }
+7
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,