diff --git a/src/modules/expenses/views/TransactionsPage.vue b/src/modules/expenses/views/TransactionsPage.vue index 9dcd525..30e4e5e 100644 --- a/src/modules/expenses/views/TransactionsPage.vue +++ b/src/modules/expenses/views/TransactionsPage.vue @@ -16,8 +16,6 @@ import { Flag, XCircle, RefreshCw, - ChevronLeft, - ChevronRight, Calendar } from 'lucide-vue-next' @@ -28,13 +26,6 @@ const expensesAPI = injectService(SERVICE_TOKENS.EXPENSES_API) const transactions = ref([]) const isLoading = ref(false) const selectedDays = ref(5) -const pagination = ref({ - total: 0, - limit: 20, - offset: 0, - has_next: false, - has_prev: false -}) const walletKey = computed(() => user.value?.wallets?.[0]?.inkey) @@ -123,19 +114,12 @@ async function loadTransactions() { isLoading.value = true try { const response = await expensesAPI.getUserTransactions(walletKey.value, { - limit: pagination.value.limit, - offset: pagination.value.offset, + limit: 1000, // Load all transactions (no pagination needed) + offset: 0, days: selectedDays.value }) transactions.value = response.entries - pagination.value = { - total: response.total, - limit: response.limit, - offset: response.offset, - has_next: response.has_next, - has_prev: response.has_prev - } } catch (error) { console.error('Failed to load transactions:', error) toast.error('Failed to load transactions', { @@ -149,26 +133,9 @@ async function loadTransactions() { // Change day filter function changeDayFilter(days: number) { selectedDays.value = days - pagination.value.offset = 0 // Reset to first page loadTransactions() } -// Next page -function nextPage() { - if (pagination.value.has_next) { - pagination.value.offset += pagination.value.limit - loadTransactions() - } -} - -// Previous page -function prevPage() { - if (pagination.value.has_prev) { - pagination.value.offset = Math.max(0, pagination.value.offset - pagination.value.limit) - loadTransactions() - } -} - onMounted(() => { loadTransactions() }) @@ -232,7 +199,7 @@ onMounted(() => { Found {{ transactionsToDisplay.length }} matching transaction{{ transactionsToDisplay.length === 1 ? '' : 's' }} - Showing {{ pagination.offset + 1 }} - {{ Math.min(pagination.offset + pagination.limit, pagination.total) }} of {{ pagination.total }} transactions + {{ transactions.length }} transaction{{ transactions.length === 1 ? '' : 's' }} @@ -323,36 +290,6 @@ onMounted(() => { - -
- - - - Page {{ Math.floor(pagination.offset / pagination.limit) + 1 }} - - - -
-

🐢