summaryrefslogtreecommitdiff
path: root/lib/tech-vendors
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-06-24 01:44:03 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-06-24 01:44:03 +0000
commit4e63d8427d26d0d1b366ddc53650e15f3481fc75 (patch)
treeddfb69a92db56498ea591eed0f14ed2ce823431c /lib/tech-vendors
parent127185717263ea3162bd192c83b4c7efe0d96e50 (diff)
(대표님/최겸) 20250624 작업사항 10시43분
Diffstat (limited to 'lib/tech-vendors')
-rw-r--r--lib/tech-vendors/service.ts23
-rw-r--r--lib/tech-vendors/table/tech-vendors-table-columns.tsx5
-rw-r--r--lib/tech-vendors/validations.ts3
3 files changed, 23 insertions, 8 deletions
diff --git a/lib/tech-vendors/service.ts b/lib/tech-vendors/service.ts
index b2dec1ab..5fd5ef02 100644
--- a/lib/tech-vendors/service.ts
+++ b/lib/tech-vendors/service.ts
@@ -78,6 +78,25 @@ export async function getTechVendors(input: GetTechVendorsSchema) {
// 최종 where 결합
const finalWhere = and(advancedWhere, globalWhere);
+ // 벤더 타입 필터링 로직 추가
+ let vendorTypeWhere;
+ if (input.vendorType) {
+ // URL의 vendorType 파라미터를 실제 벤더 타입으로 매핑
+ const vendorTypeMap = {
+ "ship": "조선",
+ "top": "해양TOP",
+ "hull": "해양HULL"
+ };
+
+ const actualVendorType = input.vendorType in vendorTypeMap
+ ? vendorTypeMap[input.vendorType as keyof typeof vendorTypeMap]
+ : undefined;
+ if (actualVendorType) {
+ // techVendorType 필드는 콤마로 구분된 문자열이므로 LIKE 사용
+ vendorTypeWhere = ilike(techVendors.techVendorType, `%${actualVendorType}%`);
+ }
+ }
+
// 간단 검색 (advancedTable=false) 시 예시
const simpleWhere = and(
input.vendorName
@@ -89,8 +108,8 @@ export async function getTechVendors(input: GetTechVendorsSchema) {
: undefined
);
- // 실제 사용될 where
- const where = finalWhere;
+ // 실제 사용될 where (vendorType 필터링 추가)
+ const where = and(finalWhere, vendorTypeWhere);
// 정렬
const orderBy =
diff --git a/lib/tech-vendors/table/tech-vendors-table-columns.tsx b/lib/tech-vendors/table/tech-vendors-table-columns.tsx
index e586a667..093b5547 100644
--- a/lib/tech-vendors/table/tech-vendors-table-columns.tsx
+++ b/lib/tech-vendors/table/tech-vendors-table-columns.tsx
@@ -131,11 +131,6 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef
>
상세보기(새창)
</DropdownMenuItem>
- <DropdownMenuItem
- onSelect={() => setRowAction({ row, type: "log" })}
- >
- 감사 로그 보기
- </DropdownMenuItem>
<Separator />
<DropdownMenuSub>
diff --git a/lib/tech-vendors/validations.ts b/lib/tech-vendors/validations.ts
index c45eb97d..ee076945 100644
--- a/lib/tech-vendors/validations.ts
+++ b/lib/tech-vendors/validations.ts
@@ -46,7 +46,8 @@ export const searchParamsCache = createSearchParamsCache({
// 예) 코드 검색
vendorCode: parseAsString.withDefault(""),
-
+ // 벤더 타입 필터링 (다중 선택 가능)
+ vendorType: parseAsStringEnum(["ship", "top", "hull"]),
// 필요하다면 이메일 검색 / 웹사이트 검색 등 추가 가능
email: parseAsString.withDefault(""),
website: parseAsString.withDefault(""),