Álvaro Valenzuela Valdes commited on
Commit ·
8cbe7e8
1
Parent(s): 6866faa
fix: ensure dashboard reflects local database content and correct total counts
Browse files- frontend/app/page.tsx +1 -1
- frontend/components/Dashboard.tsx +1 -1
- frontend/lib/api.ts +1 -1
frontend/app/page.tsx
CHANGED
|
@@ -149,7 +149,7 @@ export default function HomePage() {
|
|
| 149 |
}
|
| 150 |
|
| 151 |
try {
|
| 152 |
-
const initialTenders = await searchTenders({
|
| 153 |
setTenders(initialTenders);
|
| 154 |
} catch (e) {
|
| 155 |
console.error("Tenders load error", e);
|
|
|
|
| 149 |
}
|
| 150 |
|
| 151 |
try {
|
| 152 |
+
const initialTenders = await searchTenders({});
|
| 153 |
setTenders(initialTenders);
|
| 154 |
} catch (e) {
|
| 155 |
console.error("Tenders load error", e);
|
frontend/components/Dashboard.tsx
CHANGED
|
@@ -134,7 +134,7 @@ export default function Dashboard({
|
|
| 134 |
</div>
|
| 135 |
|
| 136 |
<div className="grid gap-5 md:grid-cols-2 xl:grid-cols-4">
|
| 137 |
-
<StatCard title={t.tendersFound} value={tendersFound} subtitle={t.activeOpps} />
|
| 138 |
<StatCard title={t.recommended} value={recommendedOpportunities} subtitle="Fit score > 80%" />
|
| 139 |
<StatCard title={t.highRisk} value={highRiskItems} subtitle="Riesgos críticos" />
|
| 140 |
<StatCard title="Portfolio" value={followedTendersCount} subtitle="Opps. guardadas" />
|
|
|
|
| 134 |
</div>
|
| 135 |
|
| 136 |
<div className="grid gap-5 md:grid-cols-2 xl:grid-cols-4">
|
| 137 |
+
<StatCard title={t.tendersFound} value={dbStatus?.total_records || tendersFound} subtitle={t.activeOpps} />
|
| 138 |
<StatCard title={t.recommended} value={recommendedOpportunities} subtitle="Fit score > 80%" />
|
| 139 |
<StatCard title={t.highRisk} value={highRiskItems} subtitle="Riesgos críticos" />
|
| 140 |
<StatCard title="Portfolio" value={followedTendersCount} subtitle="Opps. guardadas" />
|
frontend/lib/api.ts
CHANGED
|
@@ -46,7 +46,7 @@ export async function healthCheck() {
|
|
| 46 |
}
|
| 47 |
|
| 48 |
export async function fetchDbStatus() {
|
| 49 |
-
const res = await fetch(`${API_BASE}/api/
|
| 50 |
if (!res.ok) return null;
|
| 51 |
return res.json();
|
| 52 |
}
|
|
|
|
| 46 |
}
|
| 47 |
|
| 48 |
export async function fetchDbStatus() {
|
| 49 |
+
const res = await fetch(`${API_BASE}/api/admin/db-stats`);
|
| 50 |
if (!res.ok) return null;
|
| 51 |
return res.json();
|
| 52 |
}
|