Revert "Enhance dashboard data fetching by adding active site checks"
This reverts commit 75ba407df5.
This commit is contained in:
@@ -199,22 +199,16 @@ export default function Home() {
|
||||
];
|
||||
|
||||
const fetchAppInsights = async () => {
|
||||
if (!activeSite) {
|
||||
setInsights(null);
|
||||
setLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
setLoading(true);
|
||||
|
||||
const [keywordsRes, clustersRes, ideasRes, tasksRes, contentRes, imagesRes] = await Promise.all([
|
||||
fetchKeywords({ page_size: 1, site_id: activeSite.id, sector_id: activeSector?.id }),
|
||||
fetchClusters({ page_size: 1, site_id: activeSite.id, sector_id: activeSector?.id }),
|
||||
fetchContentIdeas({ page_size: 1, site_id: activeSite.id, sector_id: activeSector?.id }),
|
||||
fetchTasks({ page_size: 1, site_id: activeSite.id, sector_id: activeSector?.id }),
|
||||
fetchContent({ page_size: 1, site_id: activeSite.id, sector_id: activeSector?.id }),
|
||||
fetchContentImages({ site_id: activeSite.id, sector_id: activeSector?.id })
|
||||
fetchKeywords({ page_size: 1, site_id: undefined }),
|
||||
fetchClusters({ page_size: 1, site_id: undefined }),
|
||||
fetchContentIdeas({ page_size: 1, site_id: undefined }),
|
||||
fetchTasks({ page_size: 1, site_id: undefined }),
|
||||
fetchContent({ page_size: 1, site_id: undefined }),
|
||||
fetchContentImages({ page_size: 1, site_id: undefined })
|
||||
]);
|
||||
|
||||
const totalKeywords = keywordsRes.count || 0;
|
||||
@@ -254,7 +248,7 @@ export default function Home() {
|
||||
|
||||
useEffect(() => {
|
||||
fetchAppInsights();
|
||||
}, [activeSite?.id, activeSector?.id]);
|
||||
}, [activeSite, activeSector]);
|
||||
|
||||
const chartOptions: ApexOptions = {
|
||||
chart: {
|
||||
|
||||
Reference in New Issue
Block a user