From f02773ab37bd911b1f3a81a93a7d5aaffd04bcad Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Tue, 30 Sep 2025 19:50:09 +0900
Subject: (김준회) 스테이지 선택 로직 오류 수정 및 스크롤 처리
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../table/document-class-option-add-dialog.tsx     | 36 ++++++----------------
 1 file changed, 9 insertions(+), 27 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 31337675..ac943ceb 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
@@ -40,7 +40,7 @@ import {
 import { cn } from "@/lib/utils"
 import { useParams } from "next/navigation"
 
-import { createDocumentClassOptionItem } from "@/lib/docu-list-rule/document-class/service"
+import { createDocumentClassOptionItem, getProjectKindScheduleSetting } from "@/lib/docu-list-rule/document-class/service"
 import { getProjectCode } from "@/lib/projects/service"
 
 // API 응답 타입
@@ -54,31 +54,6 @@ interface ScheduleSetting {
   USE_YN2: string
 }
 
-// 프로젝트 일정 설정을 가져오는 함수
-async function getProjectKindScheduleSetting(projectCode: string): Promise<ScheduleSetting[]> {
-  try {
-    const response = await fetch(
-      `http://60.100.99.217/DDP/Services/VNDRService.svc/GetProjectKindScheduleSetting?PROJ_NO=${projectCode}`,
-      {
-        method: 'GET',
-        headers: {
-          'Content-Type': 'application/json',
-        },
-      }
-    )
-
-    if (!response.ok) {
-      throw new Error('Failed to fetch schedule settings')
-    }
-
-    const data = await response.json()
-    return data.GetProjectKindScheduleSettingResult || []
-  } catch (error) {
-    console.error('Error fetching schedule settings:', error)
-    return []
-  }
-}
-
 const createOptionSchema = z.object({
   optionCode: z.string().min(1, "옵션을 선택해주세요."),
 })
@@ -218,7 +193,14 @@ export function DocumentClassOptionAddDialog({ documentClassId, onSuccess }: Doc
                         <CommandEmpty>
                           {isLoading ? "로딩 중..." : "검색 결과가 없습니다."}
                         </CommandEmpty>
-                        <CommandGroup className="max-h-[200px] overflow-auto">
+                        <CommandGroup 
+                          className="max-h-[200px] overflow-auto"
+                          onWheel={(e) => {
+                            e.stopPropagation();
+                            const target = e.currentTarget;
+                            target.scrollTop += e.deltaY;
+                          }}
+                        >
                           {scheduleSettings.map((setting) => (
                             <CommandItem
                               key={setting.COL_NM}
-- 
cgit v1.2.3

