other fixes

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-19 12:47:50 +00:00
parent 6c7395262f
commit 011ecefd1b
7 changed files with 30 additions and 17 deletions

View File

@@ -155,7 +155,7 @@ export default function Clusters() {
const loadTotalMetrics = useCallback(async () => {
try {
// Batch all API calls in parallel for better performance
const [allRes, mappedRes, newRes, imagesRes] = await Promise.all([
const [allRes, mappedRes, newRes, imagesRes, summaryRes] = await Promise.all([
// Fetch all clusters (site-wide)
fetchClusters({
page_size: 1,
@@ -175,12 +175,16 @@ export default function Clusters() {
}),
// Fetch images count
fetchImages({ page_size: 1 }),
// Fetch clusters summary for keywords count and volume
fetchClustersSummary(),
]);
setActualTotalClusters(allRes.count || 0); // Store actual total (unfiltered) for header metrics
setTotalWithIdeas(mappedRes.count || 0);
setTotalReady(newRes.count || 0);
setTotalImagesCount(imagesRes.count || 0);
setTotalKeywords(summaryRes.total_keywords || 0);
setTotalVolume(summaryRes.total_volume || 0);
} catch (error) {
console.error('Error loading total metrics:', error);
}