board notfound
All checks were successful
deploy-on-main / deploy (push) Successful in 37s

This commit is contained in:
koreacomp5
2025-11-28 05:29:34 +09:00
parent c5bc8f5b49
commit c85450ce37

View File

@@ -4,7 +4,6 @@ import Link from "next/link";
import { BoardToolbar } from "@/app/components/BoardToolbar";
import { headers } from "next/headers";
import prisma from "@/lib/prisma";
import { notFound } from "next/navigation";
import { UserAvatar } from "@/app/components/UserAvatar";
import { RankIcon1st } from "@/app/components/RankIcon1st";
import { RankIcon2nd } from "@/app/components/RankIcon2nd";
@@ -34,10 +33,7 @@ export default async function BoardDetail({ params, searchParams }: { params: an
const res = await fetch(new URL("/api/boards", base).toString(), { cache: "no-store" });
const { boards } = await res.json();
const board = (boards || []).find((b: any) => b.slug === idOrSlug || b.id === idOrSlug);
if (!board) {
return notFound();
}
const id = board.id as string;
const id = board?.id as string;
const siblingBoards = (boards || []).filter((b: any) => b.category?.id && b.category.id === board?.category?.id);
const categoryName = board?.category?.name ?? "";
// 메인배너 표시 설정