mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-14 02:42:21 +00:00
fix: resolve 404 balances endpoint and currency formatting errors
- Add missing /api/v1/balances endpoint to backend - Update frontend Account type to match backend AccountDetails model - Add currency validation with EUR fallback in formatCurrency function - Update AccountsOverview, TransactionsList, and Dashboard components - Fix balance calculations to use balances array structure - All pre-commit checks pass
This commit is contained in:
committed by
Elisiário Couto
parent
947342e196
commit
417b77539f
@@ -34,7 +34,11 @@ export default function Dashboard() {
|
||||
{ name: 'Analytics', icon: BarChart3, id: 'analytics' as TabType },
|
||||
];
|
||||
|
||||
const totalBalance = accounts?.reduce((sum, account) => sum + (account.balance || 0), 0) || 0;
|
||||
const totalBalance = accounts?.reduce((sum, account) => {
|
||||
// Get the first available balance from the balances array
|
||||
const primaryBalance = account.balances?.[0]?.amount || 0;
|
||||
return sum + primaryBalance;
|
||||
}, 0) || 0;
|
||||
|
||||
return (
|
||||
<div className="flex h-screen bg-gray-100">
|
||||
|
||||
Reference in New Issue
Block a user