diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/vendors/[id]/info/layout.tsx | 10 | ||||
| -rw-r--r-- | app/[lng]/evcp/(evcp)/vendors/[id]/info/materials/page.tsx | 43 |
2 files changed, 20 insertions, 33 deletions
diff --git a/app/[lng]/evcp/(evcp)/vendors/[id]/info/layout.tsx b/app/[lng]/evcp/(evcp)/vendors/[id]/info/layout.tsx index 0817b309..17f22de9 100644 --- a/app/[lng]/evcp/(evcp)/vendors/[id]/info/layout.tsx +++ b/app/[lng]/evcp/(evcp)/vendors/[id]/info/layout.tsx @@ -42,12 +42,12 @@ export default async function SettingsLayout({ title: "신용평가", href: `/${lng}/evcp/vendors/${id}/info/credit`, }, + // { + // title: "공급품목(패키지)", + // href: `/${lng}/evcp/vendors/${id}/info/items`, + // }, { - title: "공급품목(패키지)", - href: `/${lng}/evcp/vendors/${id}/info/items`, - }, - { - title: "공급품목(자재그룹)", + title: "공급품목", href: `/${lng}/evcp/vendors/${id}/info/materials`, }, { diff --git a/app/[lng]/evcp/(evcp)/vendors/[id]/info/materials/page.tsx b/app/[lng]/evcp/(evcp)/vendors/[id]/info/materials/page.tsx index 0ebb66ba..3115ae30 100644 --- a/app/[lng]/evcp/(evcp)/vendors/[id]/info/materials/page.tsx +++ b/app/[lng]/evcp/(evcp)/vendors/[id]/info/materials/page.tsx @@ -1,9 +1,6 @@ import { Separator } from "@/components/ui/separator" -import { type SearchParams } from "@/types/table" -import { getValidFilters } from "@/lib/data-table" -import { searchParamsMaterialCache } from "@/lib/vendors/validations" -import { getVendorMaterials } from "@/lib/vendors/service" -import { VendorMaterialsTable } from "@/lib/vendors/materials-table/item-table" +import { getAllConfirmedMaterials, getAllVendorInputMaterials } from "@/lib/material/vendor-possible-material-service" +import { SimpleVendorMaterialsWrapper } from "@/lib/material/vendor-material/simple-vendor-materials-wrapper" interface IndexPageProps { // Next.js 13 App Router에서 기본으로 주어지는 객체들 @@ -11,32 +8,19 @@ interface IndexPageProps { lng: string id: string } - searchParams: Promise<SearchParams> } -export default async function SettingsAccountPage(props: IndexPageProps) { +export default async function VendorMaterialsPage(props: IndexPageProps) { const resolvedParams = await props.params - const lng = resolvedParams.lng const id = resolvedParams.id - const idAsNumber = Number(id) - // 2) SearchParams 파싱 (Zod) - // - "filters", "page", "perPage", "sort" 등 contact 전용 컬럼 - const searchParams = await props.searchParams - const search = searchParamsMaterialCache.parse(searchParams) - const validFilters = getValidFilters(search.filters) - - + // 전체 데이터를 병렬로 조회 (클라이언트에서 필터링/정렬 처리) + const [confirmedMaterials, vendorInputMaterials] = await Promise.all([ + getAllConfirmedMaterials(idAsNumber), // 확정정보 전체 + getAllVendorInputMaterials(idAsNumber) // 업체입력정보 전체 + ]); - const promises = Promise.all([ - getVendorMaterials({ - ...search, - filters: validFilters, - }, - idAsNumber) - ]) - // 4) 렌더링 return ( <div className="space-y-6"> <div> @@ -44,13 +28,16 @@ export default async function SettingsAccountPage(props: IndexPageProps) { 공급품목(자재 그룹) </h3> <p className="text-sm text-muted-foreground"> - {/* 딜리버리가 가능한 공급품목(자재 그룹)을 확인할 수 있습니다. */} + 업체의 공급 가능한 자재 그룹 정보를 확인할 수 있습니다. </p> </div> <Separator /> - <div> - <VendorMaterialsTable promises={promises} vendorId={idAsNumber}/> - </div> + + <SimpleVendorMaterialsWrapper + vendorId={idAsNumber} + initialConfirmedMaterials={confirmedMaterials} + initialVendorInputMaterials={vendorInputMaterials} + /> </div> ) }
\ No newline at end of file |
