수정
Some checks failed
deploy-on-main / deploy (push) Failing after 22s

This commit is contained in:
koreacomp5
2025-11-09 19:53:42 +09:00
parent 1c2222da67
commit cfbb3d50ee
12 changed files with 289 additions and 153 deletions

View File

@@ -23,12 +23,44 @@ export default async function PostDetail({ params }: { params: any }) {
const parsed = settingRow ? JSON.parse(settingRow.value as string) : {};
const showBanner: boolean = parsed.showBanner ?? true;
// 현재 게시글이 속한 카테고리의 보드들을 서브카테고리로 구성
let subItems:
| { id: string; name: string; href: string }[]
| undefined = undefined;
if (post?.boardId) {
const categories = await prisma.boardCategory.findMany({
where: { status: "active" },
orderBy: [{ sortOrder: "asc" }, { createdAt: "asc" }],
include: {
boards: {
where: { status: "active" },
orderBy: [{ sortOrder: "asc" }, { createdAt: "asc" }],
select: { id: true, name: true, slug: true },
},
},
});
const categoryOfPost = categories.find((c) =>
c.boards.some((b) => b.id === post.boardId)
);
if (categoryOfPost) {
subItems = categoryOfPost.boards.map((b) => ({
id: b.id,
name: b.name,
href: `/boards/${b.slug}`,
}));
}
}
return (
<div className="space-y-6">
{/* 상단 배너 */}
{showBanner && (
<section>
<HeroBanner />
<HeroBanner
subItems={subItems}
activeSubId={post?.boardId}
showPartnerCats={false}
/>
</section>
)}