faculty page
This commit is contained in:
@ -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<Metadata> {
|
||||
const memberId = Number(params.id);
|
||||
const { id } = await params; // ← Must await here too
|
||||
const memberId = Number(id);
|
||||
|
||||
if (!Number.isInteger(memberId)) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user