diff --git a/src/components/transactions/TransactionList.vue b/src/components/transactions/TransactionList.vue index 05ef78b..0cace0f 100644 --- a/src/components/transactions/TransactionList.vue +++ b/src/components/transactions/TransactionList.vue @@ -173,6 +173,31 @@ const fetchData = async (fetchPlanned: boolean = true, fetchInstant: boolean = t } +const downloadTransactions = async () => { + if (!spaceStore.selectedSpaceId) return + try { + await transactionService.exportTransactions(spaceStore.selectedSpaceId, { + query: searchQuery.value || null, + categoriesIds: selectedCategoryIds.value.length > 0 ? selectedCategoryIds.value : null, + dateFrom: filterDateFrom.value ? toDateOnly(filterDateFrom.value) : null, + dateTo: filterDateTo.value ? toDateOnly(filterDateTo.value) : null, + } as TransactionFilters) + toast.add({ + severity: 'success', + summary: 'Success', + detail: 'Transactions exported successfully', + life: 3000, + }) + } catch (e) { + toast.add({ + severity: 'error', + summary: 'Failed to export transactions.', + detail: String(e), + life: 3000, + }) + } +} + onMounted(async () => { await fetchCategories() await fetchData() @@ -194,6 +219,7 @@ onMounted(async () => { +