Fix: "Ver todas as transações" button refresh issue

The "Ver todas as transações" button was refreshing the page instead of displaying all transactions. This commit addresses the issue.
This commit is contained in:
gpt-engineer-app[bot] 2025-05-19 12:31:13 +00:00
parent 0f5e9e7d72
commit 85b4d3e795
2 changed files with 10 additions and 8 deletions

View File

@ -1,5 +1,6 @@
import { useState } from 'react'; import { useState } from 'react';
import { Link } from 'react-router-dom';
import { format } from 'date-fns'; import { format } from 'date-fns';
import { ChevronDown, Search, ChevronLeft, ChevronRight } from 'lucide-react'; import { ChevronDown, Search, ChevronLeft, ChevronRight } from 'lucide-react';
import { Transaction } from '@/types/financialTypes'; import { Transaction } from '@/types/financialTypes';
@ -236,13 +237,14 @@ const TransactionsTable = ({
{!showPagination && filteredTransactions.length > itemsPerPage && ( {!showPagination && filteredTransactions.length > itemsPerPage && (
<div className="flex justify-center pt-2"> <div className="flex justify-center pt-2">
<Button <Link to="/transacoes">
variant="outline" <Button
size="sm" variant="outline"
onClick={() => window.location.href = '/transacoes'} size="sm"
> >
Ver todas as transações Ver todas as transações
</Button> </Button>
</Link>
</div> </div>
)} )}
</div> </div>

View File

@ -45,7 +45,7 @@ const TransacoesPage = () => {
useEffect(() => { useEffect(() => {
loadTransactions(); loadTransactions();
}, [toast]); }, []);
const handleTransactionSuccess = () => { const handleTransactionSuccess = () => {
setIsDialogOpen(false); setIsDialogOpen(false);