diff options
Diffstat (limited to 'components/vendor-regular-registrations/registration-request-dialog.tsx')
| -rw-r--r-- | components/vendor-regular-registrations/registration-request-dialog.tsx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/components/vendor-regular-registrations/registration-request-dialog.tsx b/components/vendor-regular-registrations/registration-request-dialog.tsx index 99599ce5..d3aeb812 100644 --- a/components/vendor-regular-registrations/registration-request-dialog.tsx +++ b/components/vendor-regular-registrations/registration-request-dialog.tsx @@ -313,6 +313,16 @@ export function RegistrationRequestDialog({ return; } + // 업무담당자 검증 (최소 하나의 담당자라도 이름과 이메일이 있어야 함) + const hasValidBusinessContact = Object.values(formData.businessContacts).some(contact => + contact.name?.trim() && contact.email?.trim() + ); + + if (!hasValidBusinessContact) { + toast.error("업무담당자 정보를 최소 하나 이상 입력해주세요. (담당자명과 이메일 필수)"); + return; + } + if (onSubmit) { await onSubmit(formData); } @@ -599,7 +609,8 @@ export function RegistrationRequestDialog({ {/* 업무담당자 */} <div> - <h4 className="font-semibold mb-3">업무담당자</h4> + <h4 className="font-semibold mb-3">업무담당자 <span className="text-red-500">*</span></h4> + <p className="text-sm text-muted-foreground mb-4">최소 하나의 업무담당자 정보를 입력해주세요.</p> <div className="space-y-4"> {Object.entries(formData.businessContacts).map(([type, contact]) => { const labels = { @@ -615,7 +626,7 @@ export function RegistrationRequestDialog({ <h5 className="font-medium text-sm">{labels[type as keyof typeof labels]} 담당자</h5> <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"> <div> - <Label>담당자명</Label> + <Label>담당자명 <span className="text-red-500">*</span></Label> <Input value={contact.name} onChange={(e) => handleBusinessContactChange(type as keyof typeof formData.businessContacts, 'name', e.target.value)} @@ -646,7 +657,7 @@ export function RegistrationRequestDialog({ /> </div> <div> - <Label>이메일</Label> + <Label>이메일 <span className="text-red-500">*</span></Label> <Input type="email" value={contact.email} |
