Faculty update
This commit is contained in:
@@ -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 />
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { TeamMember, FacultyService } from '../../lib/facultyData';
|
||||
|
||||
interface TeamMemberDetailProps {
|
||||
memberId: number;
|
||||
memberId: string;
|
||||
memberData?: TeamMember;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user