Fix: Resolve type errors in ContasRecorrentesList

Corrected type errors in `src/components/avisos/ContasRecorrentesList.tsx` related to the `ContaRecorrente` interface and the `setContas` state update. This resolves the "Type instantiation is excessively deep" and "Type is not assignable to ContaRecorrente[]" errors.
This commit is contained in:
gpt-engineer-app[bot] 2025-06-27 15:47:02 +00:00
parent 7f3dad4f08
commit d8cd64c871

View File

@ -9,11 +9,11 @@ import StatusTags from './StatusTags';
interface ContaRecorrente { interface ContaRecorrente {
id: string; id: string;
nome: string; nome_conta: string;
valor: number; valor: number;
dia_vencimento: number; dia_vencimento: number;
email_usuario: string; email_usuario: string;
ativa: boolean; ativo: boolean;
created_at: string; created_at: string;
} }
@ -63,8 +63,8 @@ const ContasRecorrentesList = () => {
.from('contas_recorrentes') .from('contas_recorrentes')
.select('*') .select('*')
.eq('email_usuario', user.email) .eq('email_usuario', user.email)
.eq('ativa', true) .eq('ativo', true)
.order('nome'); .order('nome_conta');
if (contasError) { if (contasError) {
console.error('Erro ao buscar contas:', contasError); console.error('Erro ao buscar contas:', contasError);
@ -151,7 +151,7 @@ const ContasRecorrentesList = () => {
<Card key={conta.id} className="relative"> <Card key={conta.id} className="relative">
<CardHeader> <CardHeader>
<CardTitle className="flex justify-between items-start"> <CardTitle className="flex justify-between items-start">
<span>{conta.nome}</span> <span>{conta.nome_conta}</span>
<Badge variant="outline" className="ml-2"> <Badge variant="outline" className="ml-2">
Dia {conta.dia_vencimento} Dia {conta.dia_vencimento}
</Badge> </Badge>