build error fixes
This commit is contained in:
@ -9,9 +9,10 @@ import type { Metadata } from 'next';
|
|||||||
export default async function FacultyPage({
|
export default async function FacultyPage({
|
||||||
params,
|
params,
|
||||||
}: {
|
}: {
|
||||||
params: { id: string };
|
params: Promise<{ id: string }>;
|
||||||
}) {
|
}) {
|
||||||
const memberId = parseInt(params.id);
|
const { id } = await params;
|
||||||
|
const memberId = parseInt(id);
|
||||||
|
|
||||||
if (isNaN(memberId)) {
|
if (isNaN(memberId)) {
|
||||||
notFound();
|
notFound();
|
||||||
@ -50,9 +51,10 @@ export async function generateStaticParams() {
|
|||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params,
|
params,
|
||||||
}: {
|
}: {
|
||||||
params: { id: string };
|
params: Promise<{ id: string }>;
|
||||||
}): Promise<Metadata> {
|
}): Promise<Metadata> {
|
||||||
const memberId = parseInt(params.id);
|
const { id } = await params;
|
||||||
|
const memberId = parseInt(id);
|
||||||
|
|
||||||
if (isNaN(memberId)) {
|
if (isNaN(memberId)) {
|
||||||
return { title: 'Faculty Member Not Found - CMC Vellore' };
|
return { title: 'Faculty Member Not Found - CMC Vellore' };
|
||||||
@ -78,4 +80,4 @@ export async function generateMetadata({
|
|||||||
console.error('Error generating metadata:', error);
|
console.error('Error generating metadata:', error);
|
||||||
return { title: 'Faculty Member - CMC Vellore' };
|
return { title: 'Faculty Member - CMC Vellore' };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user