diff --git a/src/app/(app)/budgets/page.tsx b/src/app/(app)/budgets/page.tsx index 6c0ecc5..d52e5b4 100644 --- a/src/app/(app)/budgets/page.tsx +++ b/src/app/(app)/budgets/page.tsx @@ -31,10 +31,7 @@ export default async function BudgetsPage({ searchParams }: { searchParams: Sear JOIN "Account" a ON t."accountId" = a.id WHERE a."userId" = ${userId} AND t."budgetId" IS NOT NULL - AND ( - (a.type = 'CREDIT_CARD' AND t.type = 'CREDIT') - OR (a.type != 'CREDIT_CARD' AND t.type = 'DEBIT') - ) + AND (a.type = 'CREDIT_CARD' OR t.type = 'DEBIT') AND t.date >= ${start} AND t.date <= ${end} GROUP BY t."budgetId" diff --git a/src/app/(app)/dashboard/page.tsx b/src/app/(app)/dashboard/page.tsx index 7b00f0d..9adef9a 100644 --- a/src/app/(app)/dashboard/page.tsx +++ b/src/app/(app)/dashboard/page.tsx @@ -46,10 +46,7 @@ export default async function DashboardPage({ searchParams }: { searchParams: Se JOIN "Account" a ON t."accountId" = a.id WHERE a."userId" = ${userId} AND t."budgetId" IS NOT NULL - AND ( - (a.type = 'CREDIT_CARD' AND t.type = 'CREDIT') - OR (a.type != 'CREDIT_CARD' AND t.type = 'DEBIT') - ) + AND (a.type = 'CREDIT_CARD' OR t.type = 'DEBIT') AND t.date >= ${start} AND t.date <= ${end} GROUP BY t."budgetId"