summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-05-30 01:54:09 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-05-30 01:54:09 +0000
commitd59a5175210c18fcc675cde93865339abf37a406 (patch)
tree085834900e7b65c60364602432c38f3030d456e2 /app
parent3bdd648ad4cb863043db181291ddaebbc025965b (diff)
(최겸) 기술영업 아이템리스트 filter, sort 적용
Diffstat (limited to 'app')
-rw-r--r--app/[lng]/evcp/(evcp)/items-tech/page.tsx23
1 files changed, 14 insertions, 9 deletions
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) {
<ItemsShipTable
promises={Promise.all([
getShipbuildingItems({
- ...search,
- filters: validFilters,
+ ...shipbuildingSearch,
+ filters: validShipbuildingFilters,
}),
]).then(([result]) => result)}
/>
@@ -40,8 +45,8 @@ export default async function IndexPage({ searchParams }: IndexPageProps) {
<OffshoreTopTable
promises={Promise.all([
getOffshoreTopItems({
- ...search,
- filters: validFilters,
+ ...offshoreTopSearch,
+ filters: validOffshoreTopFilters,
}),
]).then(([result]) => result)}
/>
@@ -51,8 +56,8 @@ export default async function IndexPage({ searchParams }: IndexPageProps) {
<OffshoreHullTable
promises={Promise.all([
getOffshoreHullItems({
- ...search,
- filters: validFilters,
+ ...offshoreHullSearch,
+ filters: validOffshoreHullFilters,
}),
]).then(([result]) => result)}
/>