fix: build and test stability for design overhaul
Fixed missing types, import errors, and updated test suites to match the new editorial design. Verified Docker container build.
This commit is contained in:
@@ -3,7 +3,8 @@ import ProjectDetailClient from "@/app/_ui/ProjectDetailClient";
|
||||
import { notFound } from "next/navigation";
|
||||
import type { Metadata } from "next";
|
||||
import { getLanguageAlternates, toAbsoluteUrl } from "@/lib/seo";
|
||||
import { getProjectBySlug } from "@/lib/directus";
|
||||
import { getProjectBySlug, Project } from "@/lib/directus";
|
||||
import { ProjectDetailData } from "@/app/_ui/ProjectDetailClient";
|
||||
|
||||
export const revalidate = 300;
|
||||
|
||||
@@ -53,7 +54,7 @@ export default async function ProjectPage({
|
||||
},
|
||||
});
|
||||
|
||||
let projectData: any = null;
|
||||
let projectData: ProjectDetailData | null = null;
|
||||
|
||||
if (dbProject) {
|
||||
const trPreferred = dbProject.translations?.find((t) => t.locale === locale && (t?.title || t?.description));
|
||||
@@ -75,7 +76,7 @@ export default async function ProjectPage({
|
||||
title: tr?.title ?? dbProject.title,
|
||||
description: tr?.description ?? dbProject.description,
|
||||
content: localizedContent,
|
||||
};
|
||||
} as ProjectDetailData;
|
||||
} else {
|
||||
// Try Directus fallback
|
||||
const directusProject = await getProjectBySlug(slug, locale);
|
||||
@@ -83,7 +84,7 @@ export default async function ProjectPage({
|
||||
projectData = {
|
||||
...directusProject,
|
||||
id: parseInt(directusProject.id) || 0,
|
||||
};
|
||||
} as ProjectDetailData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +103,7 @@ export default async function ProjectPage({
|
||||
},
|
||||
"dateCreated": projectData.date || projectData.created_at,
|
||||
"url": toAbsoluteUrl(`/${locale}/projects/${slug}`),
|
||||
"image": projectData.imageUrl || projectData.image_url ? toAbsoluteUrl(projectData.imageUrl || projectData.image_url) : undefined,
|
||||
"image": (projectData.imageUrl || projectData.image_url) ? toAbsoluteUrl((projectData.imageUrl || projectData.image_url)!) : undefined,
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user