Implement budget display

This commit is contained in:
2022-01-23 22:24:02 +00:00
parent aae8bbb44e
commit 6086447126
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,33 @@
const budget = {
state () {
return {
Accounts: [],
Categories: [],
Transactions: [],
Assignments: []
}
},
mutations: {
setAccounts (state, accounts) {
state.Accounts = accounts;
}
},
getters: {
Accounts(state) {
return state.Accounts || [];
}
},
actions: {
fetchBudget ({state, commit, rootState}, budgetid) {
fetch("/api/v1/budget/" + budgetid, {
headers: {
'Authorization': 'Bearer ' + rootState.Session.Token
}
})
.then(x => x.json())
.then(x => commit("setAccounts", x.Accounts));
}
}
}
export default budget