Fix diverse errors
This commit is contained in:
parent
b350fe7d74
commit
9353d82648
@ -1,4 +1,5 @@
|
||||
<script>
|
||||
<script>import { NEW_BUDGET } from "../store/action-types";
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
@ -8,7 +9,7 @@
|
||||
},
|
||||
methods: {
|
||||
saveBudget () {
|
||||
this.$store.dispatch("newBudget", this.$data.budgetName);
|
||||
this.$store.dispatch(NEW_BUDGET, this.$data.budgetName);
|
||||
this.$data.dialog = false;
|
||||
},
|
||||
newBudget () {
|
||||
|
@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue"
|
||||
import { IMPORT_YNAB } from "../store/action-types";
|
||||
import { TITLE } from "../store/mutation-types"
|
||||
|
||||
export default defineComponent({
|
||||
@ -49,7 +50,7 @@ export default defineComponent({
|
||||
let formData = new FormData();
|
||||
formData.append("transactions", this.$data.transactionsFile);
|
||||
formData.append("assignments", this.$data.assignmentsFile);
|
||||
this.$store.dispatch("YNAB", formData);
|
||||
this.$store.dispatch(IMPORT_YNAB, formData);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -88,6 +88,9 @@ export const store = createStore<State>({
|
||||
addBudget(state, budget) {
|
||||
state.Budgets.set(budget.ID, budget);
|
||||
},
|
||||
addAccount(state, account) {
|
||||
state.Accounts.set(account.ID, account);
|
||||
},
|
||||
[LOGOUT](state, token) {
|
||||
state.Session = { Token: undefined, User: undefined };
|
||||
state.Budgets.clear();
|
||||
@ -102,9 +105,6 @@ export const store = createStore<State>({
|
||||
setCurrentAccountID(state, accountid) {
|
||||
state.CurrentAccountID = accountid;
|
||||
},
|
||||
setAccounts(state, accounts) {
|
||||
state.Accounts = accounts;
|
||||
},
|
||||
setTransactions(state, transactions) {
|
||||
state.Transactions = transactions;
|
||||
}
|
||||
@ -163,7 +163,9 @@ export const store = createStore<State>({
|
||||
async [FETCH_BUDGET]({ state, commit, dispatch, rootState }, budgetid) {
|
||||
const result = await dispatch("GET", { path: "/budget/" + budgetid });
|
||||
const response = await result.json();
|
||||
return commit("setAccounts", response.Accounts);
|
||||
for (const account of response.Accounts || []) {
|
||||
commit("addAccount", account);
|
||||
}
|
||||
},
|
||||
async [FETCH_ACCOUNT]({ state, commit, rootState }, accountid) {
|
||||
const result = await fetch("/api/v1/account/" + accountid + "/transactions", {
|
||||
|
Loading…
x
Reference in New Issue
Block a user