Skip to content

Commit 95cd502

Browse files
committed
chore: filter transactions by txn_date
1 parent a6b55c2 commit 95cd502

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

client/src/_vue/pages/TransactionsPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const categories = computed<Category[]>(() => transactionStore.categories);
4949
const accounts = computed<Account[]>(() => accountStore.accounts);
5050
const trTemplateCount = ref<number>(0);
5151
52-
const sort = ref(filterHelper.initSort());
52+
const sort = ref(filterHelper.initSort("txn_date"));
5353
const filterStorageIndex = ref(apiPrefix+"-filters");
5454
const filters = ref(JSON.parse(localStorage.getItem(filterStorageIndex.value) ?? "[]"));
5555
const filterOverlayRef = ref<any>(null);

client/src/utils/filter_helper.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ const makeGroupKey = (f: FilterObj): Key => `${f.source}::${f.field}::${f.operat
66
const makeValueKey = (f: FilterObj): Key => `${makeGroupKey(f)}::${JSON.stringify(f.value)}`;
77

88
const filterHelper = {
9-
initSort() {
9+
initSort(field: string = "") {
10+
if(field === "")
11+
field="created_at"
12+
1013
return {
1114
order: -1,
12-
field: 'created_at'
15+
field: field
1316
};
1417
},
1518
toggleSort(sortValue: number): number {

0 commit comments

Comments
 (0)