diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-23 03:30:01 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-23 03:30:01 +0000 |
| commit | c8cccaf1198ae48754ac036b579732018f5b448a (patch) | |
| tree | 9c64024818c2be1c7b6699b4e141729432719d86 /lib/tech-vendors/table/update-vendor-sheet.tsx | |
| parent | 835010104c25c370c1def1f2de52f518058f8b46 (diff) | |
(최겸) 기술영업 조선 rfq 수정(벤더, 담당자 임시삭제기능 추가)
Diffstat (limited to 'lib/tech-vendors/table/update-vendor-sheet.tsx')
| -rw-r--r-- | lib/tech-vendors/table/update-vendor-sheet.tsx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/tech-vendors/table/update-vendor-sheet.tsx b/lib/tech-vendors/table/update-vendor-sheet.tsx index 8498df51..3cbb2ba3 100644 --- a/lib/tech-vendors/table/update-vendor-sheet.tsx +++ b/lib/tech-vendors/table/update-vendor-sheet.tsx @@ -45,6 +45,7 @@ import { useSession } from "next-auth/react" import { TechVendor, techVendors } from "@/db/schema/techVendors"
import { updateTechVendorSchema, type UpdateTechVendorSchema } from "../validations"
import { modifyTechVendor } from "../service"
+import { normalizeEmailFields } from "../utils"
interface UpdateVendorSheetProps
extends React.ComponentPropsWithRef<typeof Sheet> {
@@ -186,12 +187,22 @@ export function UpdateVendorSheet({ vendor, ...props }: UpdateVendorSheetProps) ? `상태 변경: ${getStatusConfig(oldStatus).label} → ${getStatusConfig(newStatus).label}`
: "" // Empty string instead of undefined
+ // 이메일 필드들을 소문자로 변환
+ const normalizedEmails = normalizeEmailFields({
+ email: data.email,
+ agentEmail: data.agentEmail,
+ representativeEmail: data.representativeEmail,
+ })
+
// 업체 정보 업데이트 - userId와 상태 변경 코멘트 추가
- const { error } = await modifyTechVendor({
+ const { error } = await modifyTechVendor({
id: String(vendor.id),
userId: Number(session.user.id), // Add user ID from session
comment: statusComment, // Add comment for status changes
...data, // 모든 데이터 전달 - 서비스 함수에서 필요한 필드만 처리
+ email: normalizedEmails.email || undefined,
+ agentEmail: normalizedEmails.agentEmail || undefined,
+ representativeEmail: normalizedEmails.representativeEmail || undefined,
techVendorType: Array.isArray(data.techVendorType) ? data.techVendorType.join(',') : undefined,
})
|
