File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
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 { notFound } from 'next/navigation';
import { verifySession } from '@/lib/auth/dal';
import { fetchCommonCodes } from '@/lib/data/repositories/common-code-repository';
import { fetchMerchantDetail } from '@/lib/data/repositories/merchant-detail-repository';
import { fetchMerchantProducts } from '@/lib/data/repositories/merchant-product-repository';
import { CODE_GROUP } from '@/lib/domain/common-code';
import { MerchantDetailForm } from './_components/merchant-detail-form';
export const metadata: Metadata = { title: '가맹몰 상세 정보' };
export const dynamic = 'force-dynamic';
interface PageProps {
params: Promise<{ frcsNo: string }>;
}
/**
* 상세가 있는 가맹점의 상세 화면. 상세가 없으면 백엔드(feature/voc)가 NOT_FOUND를 주므로 404다 —
* develop 백엔드는 가맹점 행을 그대로 주므로 `hasDetail`로 한 번 더 거른다(수정이 빈 UPDATE가 되지 않게).
*/
export default async function Page({ params }: PageProps) {
await verifySession();
const { frcsNo } = await params;
const detail = await fetchMerchantDetail(frcsNo);
if (!detail || !detail.hasDetail) {
notFound();
}
const [products, categories] = await Promise.all([
fetchMerchantProducts(frcsNo),
fetchCommonCodes(CODE_GROUP.merchantType),
]);
return <MerchantDetailForm detail={detail} products={products} categories={categories} />;
}