{{ $route.params.budgetid }}
+{{ account.Name }} / {{ account.Balance.Int / 100 }}
\ No newline at end of file diff --git a/web/src/store/budget/index.js b/web/src/store/budget/index.js new file mode 100644 index 0000000..c211d08 --- /dev/null +++ b/web/src/store/budget/index.js @@ -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 \ No newline at end of file