From eef03a970cb71ac6dea6a1a49426f045e58cb3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C4=B0pek?= Date: Sat, 7 Feb 2026 17:13:32 +0300 Subject: [PATCH] refactor: Refine workspace project types - Explicitly type `project` in `WorkspacePage` - Add `typecheck` script to `package.json` - Improve type safety and development experience --- app/(dashboard)/workspaces/[workspaceId]/page.tsx | 5 ++++- package.json | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/(dashboard)/workspaces/[workspaceId]/page.tsx b/app/(dashboard)/workspaces/[workspaceId]/page.tsx index 774899a..6671840 100644 --- a/app/(dashboard)/workspaces/[workspaceId]/page.tsx +++ b/app/(dashboard)/workspaces/[workspaceId]/page.tsx @@ -16,6 +16,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com import { Badge } from '@/components/ui/badge'; import { auth } from '@/lib/auth'; import { db } from '@/lib/db'; +import type { Prisma } from '@prisma/client'; function VisibilityIcon({ visibility }: { visibility: string }) { switch (visibility) { @@ -144,7 +145,9 @@ export default async function WorkspacePage({ params }: WorkspacePageProps) { {/* Projects Grid */} {workspace.projects.length > 0 ? (
- {workspace.projects.map((project) => ( + {workspace.projects.map((project: Prisma.ProjectGetPayload<{ + include: { _count: { select: { videos: true; members: true } } }; + }>) => ( diff --git a/package.json b/package.json index d4d7f64..5c89cea 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build": "next build", "start": "next start", "lint": "eslint", + "typecheck": "tsc --noEmit", "db:generate": "prisma generate", "db:push": "prisma db push", "db:migrate": "prisma migrate deploy",