Implement API endpoint for transactions

This commit is contained in:
2022-01-25 19:17:48 +00:00
parent 458f4f0e8f
commit c2bbaebfd2
4 changed files with 33 additions and 3 deletions

View File

@ -14,6 +14,9 @@ const budget = {
},
setCurrentAccount(state, account) {
state.CurrentAccount = account;
},
setTransactions(state, transactions){
state.Transactions = transactions;
}
},
getters: {
@ -44,7 +47,7 @@ const budget = {
return commit("setAccounts", response.Accounts);
},
async fetchAccount ({state, commit, rootState}, accountid) {
const result = await fetch("/api/v1/account/" + accountid, {
const result = await fetch("/api/v1/account/" + accountid + "/transactions", {
headers: {
'Authorization': 'Bearer ' + rootState.Session.Token
}