From d6cf4d3f0ec9bdf3f0e1da76155f365b355b5835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=20=28Claude=29?= Date: Wed, 10 Jun 2026 09:16:35 +0300 Subject: [PATCH] fix: channelStats not defined on admin dashboard --- app/admin/(protected)/page.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/admin/(protected)/page.js b/app/admin/(protected)/page.js index a98aca1..78cd6d9 100644 --- a/app/admin/(protected)/page.js +++ b/app/admin/(protected)/page.js @@ -26,13 +26,15 @@ function StatCard({ label, value, icon: Icon, color = 'emerald' }) { export default async function AdminDashboard() { - const [articles, stats] = await Promise.allSettled([ + const [articles, stats, channelSummary] = await Promise.allSettled([ adminListArticles({ limit: 50 }), getStats(), + getChannelSummary(), ]); const arts = articles.status === 'fulfilled' ? (Array.isArray(articles.value) ? articles.value : articles.value?.articles || []) : []; const st = stats.status === 'fulfilled' ? stats.value : null; + const channelStats = channelSummary.status === 'fulfilled' ? channelSummary.value : null; const published = arts.filter(a => a.status === 'published').length; const drafts = arts.filter(a => a.status === 'draft').length;