Revert "Enhance dashboard data fetching by adding active site checks"

This reverts commit 75ba407df5.
This commit is contained in:
alorig
2025-11-17 17:28:30 +05:00
parent ea9ffedc01
commit fe7af3c81c
3 changed files with 16 additions and 42 deletions

View File

@@ -78,19 +78,13 @@ export default function WriterDashboard() {
const [lastUpdated, setLastUpdated] = useState<Date>(new Date());
const fetchDashboardData = async () => {
if (!activeSite) {
setStats(null);
setLoading(false);
return;
}
try {
setLoading(true);
const [tasksRes, contentRes, imagesRes] = await Promise.all([
fetchTasks({ page_size: 1000, site_id: activeSite.id, sector_id: activeSector?.id }),
fetchContent({ page_size: 1000, site_id: activeSite.id, sector_id: activeSector?.id }),
fetchContentImages({ site_id: activeSite.id, sector_id: activeSector?.id })
fetchTasks({ page_size: 1000, sector_id: activeSector?.id }),
fetchContent({ page_size: 1000, sector_id: activeSector?.id }),
fetchContentImages({ sector_id: activeSector?.id })
]);
const tasks = tasksRes.results || [];
@@ -453,11 +447,7 @@ export default function WriterDashboard() {
<PageMeta title="Writer Dashboard - IGNY8" description="Content creation overview" />
<div className="text-center py-12">
<p className="text-gray-600 dark:text-gray-400">
{!activeSite
? 'Select an active site to view writer insights.'
: activeSector
? 'No data available for the selected sector.'
: 'No data available. Select a sector or wait for data to load.'}
{activeSector ? 'No data available for the selected sector.' : 'No data available. Select a sector or wait for data to load.'}
</p>
</div>
</>