From aa34004b7b83a9e7945a90acecf79850c3690ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C4=B0pek?= Date: Sat, 7 Feb 2026 17:02:08 +0300 Subject: [PATCH] refactor: Refine type definitions - Enhance type safety for dashboard projects - Generalize `withCacheControl` to accept any `Response` --- app/(dashboard)/dashboard/page.tsx | 2 +- lib/api-response.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/(dashboard)/dashboard/page.tsx b/app/(dashboard)/dashboard/page.tsx index 7946270..8aa65e6 100644 --- a/app/(dashboard)/dashboard/page.tsx +++ b/app/(dashboard)/dashboard/page.tsx @@ -78,7 +78,7 @@ export default async function DashboardPage() { } const workspaces = Array.from(workspaceMap, ([id, name]) => ({ id, name })); - const serializedProjects = projects.map((p) => ({ + const serializedProjects = projects.map((p: typeof projects[0]) => ({ id: p.id, name: p.name, description: p.description, diff --git a/lib/api-response.ts b/lib/api-response.ts index 25539b4..230fe51 100644 --- a/lib/api-response.ts +++ b/lib/api-response.ts @@ -126,7 +126,7 @@ export function successResponse( return NextResponse.json(body, { status }); } -export function withCacheControl(response: NextResponse, value: string): NextResponse { +export function withCacheControl(response: Response, value: string): Response { response.headers.set('Cache-Control', value); return response; }