From d59a5175210c18fcc675cde93865339abf37a406 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Fri, 30 May 2025 01:54:09 +0000 Subject: (최겸) 기술영업 아이템리스트 filter, sort 적용 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/[lng]/evcp/(evcp)/items-tech/page.tsx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/[lng]/evcp/(evcp)/items-tech/page.tsx b/app/[lng]/evcp/(evcp)/items-tech/page.tsx index 52ff519d..55ac9c63 100644 --- a/app/[lng]/evcp/(evcp)/items-tech/page.tsx +++ b/app/[lng]/evcp/(evcp)/items-tech/page.tsx @@ -3,7 +3,7 @@ import { type SearchParams } from "@/types/table" import { getValidFilters } from "@/lib/data-table" import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton" -import { searchParamsCache } from "@/lib/items-tech/validations" +import { shipbuildingSearchParamsCache, offshoreTopSearchParamsCache, offshoreHullSearchParamsCache } from "@/lib/items-tech/validations" import { getShipbuildingItems, getOffshoreTopItems, getOffshoreHullItems } from "@/lib/items-tech/service" import { OffshoreTopTable } from "@/lib/items-tech/table/top/offshore-top-table" import { OffshoreHullTable } from "@/lib/items-tech/table/hull/offshore-hull-table" @@ -17,8 +17,13 @@ interface IndexPageProps { export default async function IndexPage({ searchParams }: IndexPageProps) { const params = await searchParams - const search = searchParamsCache.parse(params) - const validFilters = getValidFilters(search.filters || []) + const shipbuildingSearch = shipbuildingSearchParamsCache.parse(params) + const offshoreTopSearch = offshoreTopSearchParamsCache.parse(params) + const offshoreHullSearch = offshoreHullSearchParamsCache.parse(params) + const validShipbuildingFilters = getValidFilters(shipbuildingSearch.filters || []) + const validOffshoreTopFilters = getValidFilters(offshoreTopSearch.filters || []) + const validOffshoreHullFilters = getValidFilters(offshoreHullSearch.filters || []) + // URL에서 아이템 타입 가져오기 const itemType = params.type || "ship" @@ -29,8 +34,8 @@ export default async function IndexPage({ searchParams }: IndexPageProps) { result)} /> @@ -40,8 +45,8 @@ export default async function IndexPage({ searchParams }: IndexPageProps) { result)} /> @@ -51,8 +56,8 @@ export default async function IndexPage({ searchParams }: IndexPageProps) { result)} /> -- cgit v1.2.3