Implement filtering on frontend

This commit is contained in:
2022-04-24 20:40:41 +00:00
committed by Gitea
parent dc15ae307b
commit f437491823
3 changed files with 24 additions and 7 deletions

View File

@ -90,12 +90,14 @@ export const useTransactionsStore = defineStore("budget/transactions", {
this.AddTransactions(transactions);
this.ProblematicTransactions = [...transactions?.map((x : Transaction) => x.ID)];
},
async GetFilteredTransactions(accountID : string | null, categoryID : string | null, payeeID : string | null) {
async GetFilteredTransactions(accountID : string | null, categoryID : string | null, payeeID : string | null, fromDate : string, toDate : string) {
const budgetStore = useBudgetsStore();
const payload = JSON.stringify({
category_id: categoryID,
payee_id: payeeID,
account_id: accountID,
from_date: fromDate,
to_date: toDate,
});
const result = await POST("/budget/" + budgetStore.CurrentBudgetID + "/filtered-transactions", payload);
const response = await result.json();