File name
Commit message
Commit date
File name
Commit message
Commit date
09-04
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
import type { Metadata } from 'next';
import { verifySession } from '@/lib/auth/dal';
import { fetchBoardPosts } from '@/lib/data/repositories/board-post-repository';
import { parseBoardPostQuery } from '@/lib/domain/board-post-query';
import { BoardPostList } from '../_components/board-post-list';
export const metadata: Metadata = { title: '공지사항' };
export const dynamic = 'force-dynamic';
interface PageProps {
searchParams: Promise<Record<string, string | string[] | undefined>>;
}
export default async function Page({ searchParams }: PageProps) {
await verifySession();
const query = parseBoardPostQuery('notice', await searchParams);
const { items, totalCount } = await fetchBoardPosts('notice', query);
const totalPages = Math.max(1, Math.ceil(totalCount / query.pageSize));
const currentPage = Math.min(query.page, totalPages);
return (
<BoardPostList
boardType="notice"
title="공지사항 목록"
breadcrumb={[
{ label: '홈', href: '/' },
{ label: '게시판 관리(고객센터)' },
{ label: '공지사항' },
]}
items={items}
query={query}
currentPage={currentPage}
totalPages={totalPages}
totalCount={totalCount}
/>
);
}