From 9225e6c7cecb8e0ac8ed0f56d9be5c87b1092d7d Mon Sep 17 00:00:00 2001 From: mukeshs Date: Wed, 6 May 2026 15:27:31 +0530 Subject: [PATCH] Faculty update --- src/app/faculty/[id]/page.tsx | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/src/app/faculty/[id]/page.tsx b/src/app/faculty/[id]/page.tsx index bfab023..07c95a5 100644 --- a/src/app/faculty/[id]/page.tsx +++ b/src/app/faculty/[id]/page.tsx @@ -52,44 +52,32 @@ export default async function FacultyPage({ params }: PageProps) { // -------------------- // Metadata generation // -------------------- -export async function generateMetadata( - { params }: PageProps -): Promise { - const { id } = await params; // ← Must await here too - const memberId = Number(id); +export async function generateMetadata({ params }: PageProps): Promise { + const { id } = await params; - if (!Number.isInteger(memberId)) { - return { - title: "Faculty Member Not Found - CMC Vellore", - }; + if (!id) { + return { title: "Faculty Member Not Found - CMC Vellore" }; } try { - const memberData = await FacultyService.getFacultyById(memberId); + const memberData = await FacultyService.getFacultyById(id); // ← pass id directly, no Number() if (!memberData) { - return { - title: "Faculty Member Not Found - CMC Vellore", - }; + return { title: "Faculty Member Not Found - CMC Vellore" }; } return { title: `${memberData.name} - ${memberData.designation} | CMC Vellore`, description: - memberData.description ?? - `${memberData.name} faculty profile at CMC Vellore`, + memberData.description ?? `${memberData.name} faculty profile at CMC Vellore`, openGraph: { title: `${memberData.name} - ${memberData.designation}`, - description: - memberData.description ?? - `${memberData.name} faculty profile`, + description: memberData.description ?? `${memberData.name} faculty profile`, images: memberData.image ? [memberData.image] : [], }, }; } catch (err) { console.error("Error generating metadata:", err); - return { - title: "Faculty Member - CMC Vellore", - }; + return { title: "Faculty Member - CMC Vellore" }; } } \ No newline at end of file