Make UI work for problematic and filtered transactions

This commit is contained in:
2022-04-24 20:12:41 +00:00
committed by Gitea
parent a7e1826f52
commit 77c1a6dd18
2 changed files with 18 additions and 7 deletions

View File

@ -86,8 +86,9 @@ export const useTransactionsStore = defineStore("budget/transactions", {
const budgetStore = useBudgetsStore();
const result = await GET("/budget/" + budgetStore.CurrentBudgetID + "/problematic-transactions");
const response = await result.json();
this.AddTransactions(response.Transactions);
this.ProblematicTransactions = [...response.Transactions.map((x : Transaction) => x.ID)];
const transactions = response.Transactions ?? [];
this.AddTransactions(transactions);
this.ProblematicTransactions = [...transactions?.map((x : Transaction) => x.ID)];
},
async GetFilteredTransactions(accountID : string | null, categoryID : string | null, payeeID : string | null) {
const budgetStore = useBudgetsStore();
@ -98,8 +99,9 @@ export const useTransactionsStore = defineStore("budget/transactions", {
});
const result = await POST("/budget/" + budgetStore.CurrentBudgetID + "/filtered-transactions", payload);
const response = await result.json();
this.AddTransactions(response.Transactions);
this.FilteredTransactions = [...response.Transactions.map((x : Transaction) => x.ID)];
const transactions = response.Transactions ?? [];
this.AddTransactions(transactions);
this.FilteredTransactions = [...transactions.map((x : Transaction) => x.ID)];
},
async SubmitReconcilation(reconciliationTransactionAmount: number) {
const accountsStore = useAccountStore();