From 10f90dc68dec42e9a64e081cc0dce6a484447290 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Tue, 29 Jul 2025 11:48:59 +0000
Subject: (대표님, 박서영, 최겸) document-list-only, gtc, vendorDocu,
 docu-list-rule
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../table/combo-box-options-add-dialog.tsx         | 23 ++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

(limited to 'lib/docu-list-rule/combo-box-settings/table/combo-box-options-add-dialog.tsx')

diff --git a/lib/docu-list-rule/combo-box-settings/table/combo-box-options-add-dialog.tsx b/lib/docu-list-rule/combo-box-settings/table/combo-box-options-add-dialog.tsx
index 1fb8950c..a5a8af2f 100644
--- a/lib/docu-list-rule/combo-box-settings/table/combo-box-options-add-dialog.tsx
+++ b/lib/docu-list-rule/combo-box-settings/table/combo-box-options-add-dialog.tsx
@@ -30,7 +30,8 @@ import { Input } from "@/components/ui/input"
 import { createComboBoxOption } from "../service"
 
 const createOptionSchema = z.object({
-  description: z.string().min(1, "값은 필수입니다."),
+  code: z.string().min(1, "코드는 필수입니다."),
+  description: z.string().default("-"),
   remark: z.string().optional(),
 })
 
@@ -48,7 +49,8 @@ export function ComboBoxOptionsAddDialog({ codeGroupId, onSuccess }: ComboBoxOpt
   const form = useForm<CreateOptionSchema>({
     resolver: zodResolver(createOptionSchema),
     defaultValues: {
-      description: "",
+      code: "",
+      description: "-",
       remark: "",
     },
   })
@@ -58,8 +60,8 @@ export function ComboBoxOptionsAddDialog({ codeGroupId, onSuccess }: ComboBoxOpt
       try {
         const result = await createComboBoxOption({
           codeGroupId,
-          code: "", // 서비스에서 자동 생성
-          description: data.description,
+          code: data.code,
+          description: data.description || "-",
           remark: data.remark,
         })
 
@@ -100,6 +102,19 @@ export function ComboBoxOptionsAddDialog({ codeGroupId, onSuccess }: ComboBoxOpt
         </DialogHeader>
         <Form {...form}>
           <form onSubmit={form.handleSubmit(handleSubmit)} className="space-y-4">
+            <FormField
+              control={form.control}
+              name="code"
+              render={({ field }) => (
+                <FormItem>
+                  <FormLabel>코드</FormLabel>
+                  <FormControl>
+                    <Input {...field} placeholder="옵션 코드" />
+                  </FormControl>
+                  <FormMessage />
+                </FormItem>
+              )}
+            />
             <FormField
               control={form.control}
               name="description"
-- 
cgit v1.2.3

