From e5bec15401c137c9bed63b2c34a82b6f1cda41d7 Mon Sep 17 00:00:00 2001 From: mukeshs Date: Tue, 17 Feb 2026 19:05:55 +0530 Subject: [PATCH] faculty page --- src/app/faculty/[id]/page.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/faculty/[id]/page.tsx b/src/app/faculty/[id]/page.tsx index b1e0f43..17b52a7 100644 --- a/src/app/faculty/[id]/page.tsx +++ b/src/app/faculty/[id]/page.tsx @@ -12,13 +12,14 @@ export const dynamic = "force-dynamic"; export const dynamicParams = true; type PageProps = { - params: { + params: Promise<{ // ← Now a Promise in Next.js 15 id: string; - }; + }>; }; export default async function FacultyPage({ params }: PageProps) { - const memberId = Number(params.id); + const { id } = await params; // ← Must await before accessing + const memberId = Number(id); // Guard against invalid IDs if (!Number.isInteger(memberId)) { @@ -56,7 +57,8 @@ export default async function FacultyPage({ params }: PageProps) { export async function generateMetadata( { params }: PageProps ): Promise { - const memberId = Number(params.id); + const { id } = await params; // ← Must await here too + const memberId = Number(id); if (!Number.isInteger(memberId)) { return { @@ -92,4 +94,4 @@ export async function generateMetadata( title: "Faculty Member - CMC Vellore", }; } -} +} \ No newline at end of file