From 6a5bf419e292cf87276e38d9fc7816ca5152a214 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Fri, 23 Sep 2022 19:43:48 +0000 Subject: [PATCH] Remove unused account.Transactions --- web/src/stores/budget-account.ts | 2 -- web/src/stores/transactions.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/web/src/stores/budget-account.ts b/web/src/stores/budget-account.ts index e41e1a7..88aaecc 100644 --- a/web/src/stores/budget-account.ts +++ b/web/src/stores/budget-account.ts @@ -22,7 +22,6 @@ export interface Account { ClearedBalance: number; WorkingBalance: number; ReconciledBalance: number; - Transactions: string[]; LastReconciled: NullDate; } @@ -190,7 +189,6 @@ export const useAccountStore = defineStore("budget/account", { transactionsStore.AddTransactions( response.Transactions ); - account.Transactions = response.Transactions.map((x : Transaction) =>x.ID); }, async FetchMonthBudget(budgetid: string, year: number, month: number) { const result = await GET( diff --git a/web/src/stores/transactions.ts b/web/src/stores/transactions.ts index ff0fc7d..ab4ddf9 100644 --- a/web/src/stores/transactions.ts +++ b/web/src/stores/transactions.ts @@ -52,7 +52,7 @@ export const useTransactionsStore = defineStore("budget/transactions", { const account = accountsStore.CurrentAccount; if(account === undefined) return undefined; - const allTransactions = account!.Transactions.map(x => this.Transactions.get(x) ?? {} as Transaction); + const allTransactions = [...this.Transactions.values()].filter(x => x.AccountID == account.ID); return groupBy(allTransactions, x => formatDate(x.Date)); }, TransactionsList(state) : Transaction[] {