other fixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user