Faculty update

This commit is contained in:
2026-05-06 14:14:59 +05:30
parent 4fc0be9071
commit 8697136f0d
3 changed files with 6 additions and 18 deletions
+4 -6
View File
@@ -18,18 +18,16 @@ type PageProps = {
};
export default async function FacultyPage({ params }: PageProps) {
const { id } = await params; // ← Must await before accessing
const memberId = Number(id);
const { id } = await params;
// Guard against invalid IDs
if (!Number.isInteger(memberId)) {
if (!id) {
notFound();
}
let memberData;
try {
memberData = await FacultyService.getFacultyById(memberId);
memberData = await FacultyService.getFacultyById(id); // pass string, not Number
} catch (err) {
console.error("Error loading faculty member:", err);
notFound();
@@ -43,7 +41,7 @@ export default async function FacultyPage({ params }: PageProps) {
<>
<Header />
<TeamMemberDetail
memberId={memberId}
memberId={id} // string
memberData={memberData}
/>
<Footer />
+1 -11
View File
@@ -173,17 +173,7 @@ const TeamListing: React.FC<TeamListingProps> = ({
)}
<div className="p-4 sm:p-6">
{/* Status badge for alumni */}
{(isRetired || isResigned) && (
<div className="mb-2">
<span
className="inline-block px-2 py-0.5 text-xs font-medium rounded-full text-white"
style={{ backgroundColor: isResigned ? '#6b7280' : '#dc2626' }}
>
{isResigned ? 'Resigned' : 'Retired'}
</span>
</div>
)}
<h3
className="text-lg font-medium mb-2 group-hover:opacity-70 transition-opacity"
+1 -1
View File
@@ -12,7 +12,7 @@ import {
import { TeamMember, FacultyService } from '../../lib/facultyData';
interface TeamMemberDetailProps {
memberId: number;
memberId: string;
memberData?: TeamMember;
}