From fca0f438d84b121d813d4a2cf13f234f12c6e7c9 Mon Sep 17 00:00:00 2001 From: UltraLionFr Date: Sun, 7 Dec 2025 00:44:44 +0100 Subject: [PATCH] update --- app/dashboard/categories/page.tsx | 14 +++++++++++--- app/dashboard/editer/[id]/page.tsx | 5 ++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/dashboard/categories/page.tsx b/app/dashboard/categories/page.tsx index 25e908d..1750618 100644 --- a/app/dashboard/categories/page.tsx +++ b/app/dashboard/categories/page.tsx @@ -110,9 +110,16 @@ export default async function CategoriesPage() { // Compter les tutoriels par catégorie const counts = await prisma.tutorial.groupBy({ by: ["categoryId"], - _count: true, + _count: { + _all: true, + }, }); - const countMap = new Map(counts.map((c) => [c.categoryId, c._count])); + const countMap = new Map( + counts.map((c: (typeof counts)[number]) => [ + c.categoryId, + c._count._all, + ]) + ); return (
@@ -208,7 +215,8 @@ export default async function CategoriesPage() {
{categories.map((cat) => { - const tutorialCount = countMap.get(cat.id) || 0; + const tutorialCount = + (countMap.get(cat.id) as number) || 0; return (