Remove unneeded assignment
This commit is contained in:
@ -32,7 +32,7 @@ const budget = {
|
||||
})
|
||||
.then(x => x.json())
|
||||
.then(x => commit("setAccounts", x.Accounts));
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,10 @@ const dashboard = {
|
||||
},
|
||||
mutations: {
|
||||
setBudgets (state, budgets) {
|
||||
state.Budgets = budgets;
|
||||
state.Budgets = budgets;
|
||||
},
|
||||
addBudget(state, budget) {
|
||||
state.Budgets.push(budget);
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
@ -24,6 +27,17 @@ const dashboard = {
|
||||
})
|
||||
.then(x => x.json())
|
||||
.then(x => commit("setBudgets", x.Budgets));
|
||||
},
|
||||
newBudget ({state, commit, rootState}, budgetName) {
|
||||
fetch("/api/v1/budget/new", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({name: budgetName}),
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + rootState.Session.Token
|
||||
}
|
||||
})
|
||||
.then(x => x.json())
|
||||
.then(x => commit("addBudget", x.Budget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user