From 4e328f0b6a5832677cfd23f49ff71e3e203026e7 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Tue, 30 Sep 2025 11:50:18 +0000
Subject: (김준회) 옵션 선택 및 설명 저장 로직 구현
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../document-class/table/document-class-option-add-dialog.tsx     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'lib/docu-list-rule/document-class/table/document-class-option-add-dialog.tsx')

diff --git a/lib/docu-list-rule/document-class/table/document-class-option-add-dialog.tsx b/lib/docu-list-rule/document-class/table/document-class-option-add-dialog.tsx
index ac943ceb..5c6e23dd 100644
--- a/lib/docu-list-rule/document-class/table/document-class-option-add-dialog.tsx
+++ b/lib/docu-list-rule/document-class/table/document-class-option-add-dialog.tsx
@@ -56,6 +56,7 @@ interface ScheduleSetting {
 
 const createOptionSchema = z.object({
   optionCode: z.string().min(1, "옵션을 선택해주세요."),
+  description: z.string().optional(),
 })
 
 type CreateOptionSchema = z.infer<typeof createOptionSchema>
@@ -78,6 +79,7 @@ export function DocumentClassOptionAddDialog({ documentClassId, onSuccess }: Doc
     resolver: zodResolver(createOptionSchema),
     defaultValues: {
       optionCode: "",
+      description: "",
     },
   })
 
@@ -116,6 +118,7 @@ export function DocumentClassOptionAddDialog({ documentClassId, onSuccess }: Doc
         const result = await createDocumentClassOptionItem({
           documentClassId,
           optionCode: data.optionCode,
+          description: data.description,
         })
 
         if (result.success) {
@@ -193,7 +196,7 @@ export function DocumentClassOptionAddDialog({ documentClassId, onSuccess }: Doc
                         <CommandEmpty>
                           {isLoading ? "로딩 중..." : "검색 결과가 없습니다."}
                         </CommandEmpty>
-                        <CommandGroup 
+                        <CommandGroup
                           className="max-h-[200px] overflow-auto"
                           onWheel={(e) => {
                             e.stopPropagation();
@@ -206,7 +209,8 @@ export function DocumentClassOptionAddDialog({ documentClassId, onSuccess }: Doc
                               key={setting.COL_NM}
                               value={`${setting.COL_NM} ${setting.PROJ_COL_NM}`}
                               onSelect={() => {
-                                form.setValue("optionCode", setting.COL_NM)
+                                form.setValue("optionCode", setting.COL_NM, { shouldValidate: true })
+                                form.setValue("description", setting.PROJ_COL_NM || "", { shouldValidate: true })
                                 setComboboxOpen(false)
                               }}
                             >
-- 
cgit v1.2.3

