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/contacts-table/update-contact-sheet.tsx | |
| parent | 835010104c25c370c1def1f2de52f518058f8b46 (diff) | |
(최겸) 기술영업 조선 rfq 수정(벤더, 담당자 임시삭제기능 추가)
Diffstat (limited to 'lib/tech-vendors/contacts-table/update-contact-sheet.tsx')
| -rw-r--r-- | lib/tech-vendors/contacts-table/update-contact-sheet.tsx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/tech-vendors/contacts-table/update-contact-sheet.tsx b/lib/tech-vendors/contacts-table/update-contact-sheet.tsx index 4713790c..877e8b4f 100644 --- a/lib/tech-vendors/contacts-table/update-contact-sheet.tsx +++ b/lib/tech-vendors/contacts-table/update-contact-sheet.tsx @@ -28,6 +28,7 @@ import { Loader2 } from "lucide-react" import type { TechVendorContact } from "@/db/schema/techVendors"
import { updateTechVendorContactSchema, type UpdateTechVendorContactSchema } from "../validations"
import { updateTechVendorContact } from "../service"
+import { normalizeEmail } from "../utils"
interface UpdateContactSheetProps
extends React.ComponentPropsWithoutRef<typeof Sheet> {
@@ -67,13 +68,19 @@ export function UpdateContactSheet({ contact, vendorId, ...props }: UpdateContac async function onSubmit(data: UpdateTechVendorContactSchema) {
if (!contact) return
-
+
startTransition(async () => {
try {
- const { error } = await updateTechVendorContact({
+ // 이메일을 소문자로 변환
+ const normalizedData = {
+ ...data,
+ contactEmail: normalizeEmail(data.contactEmail) || undefined,
+ }
+
+ const { error } = await updateTechVendorContact({
id: contact.id,
vendorId: vendorId,
- ...data
+ ...normalizedData,
})
if (error) throw new Error(error)
|
