File name
Commit message
Commit date
File name
Commit message
Commit date
09-16
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 { verifySession } from '@/lib/auth/dal';
import { fetchCommonCodes } from '@/lib/data/repositories/common-code-repository';
import { CODE_GROUP } from '@/lib/domain/common-code';
import { fetchPointStandards } from '@/lib/data/repositories/point-standard-repository';
import { parsePointStandardQuery } from '@/lib/domain/point-standard-query';
import { PointStandardList } from './_components/point-standard-list';
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 = parsePointStandardQuery(await searchParams);
const { items, totalCount } = await fetchPointStandards(query);
const eventCodes = await fetchCommonCodes(CODE_GROUP.pointEvent);
const totalPages = Math.max(1, Math.ceil(totalCount / query.pageSize));
const currentPage = Math.min(query.page, totalPages);
return (
<PointStandardList
items={items}
query={query}
currentPage={currentPage}
totalPages={totalPages}
totalCount={totalCount}
eventCodes={eventCodes}
/>
);
}