From f30678aa2956620177e61cbcc0fb57e9ce6872f1 Mon Sep 17 00:00:00 2001
From: 0-Zz-ang <s1998319@gmail.com>
Date: Sat, 9 Aug 2025 01:09:20 +0900
Subject: (박서영)docu-list-rule페이지 내 프로젝트 해양만조회가능하도록 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../code-groups/table/code-groups-add-dialog.tsx             | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

(limited to 'lib/docu-list-rule/code-groups/table/code-groups-add-dialog.tsx')

diff --git a/lib/docu-list-rule/code-groups/table/code-groups-add-dialog.tsx b/lib/docu-list-rule/code-groups/table/code-groups-add-dialog.tsx
index a0143239..33dfdd03 100644
--- a/lib/docu-list-rule/code-groups/table/code-groups-add-dialog.tsx
+++ b/lib/docu-list-rule/code-groups/table/code-groups-add-dialog.tsx
@@ -56,7 +56,7 @@ interface CodeGroupsAddDialogProps {
 export function CodeGroupsAddDialog({ onSuccess }: CodeGroupsAddDialogProps) {
   const [open, setOpen] = React.useState(false)
   const [isLoading, setIsLoading] = React.useState(false)
-  const [projects, setProjects] = React.useState<Array<{ id: number; code: string; name: string }>>([])
+  const [projects, setProjects] = React.useState<Array<{ id: number; code: string; name: string; type: string }>>([])
 
   const form = useForm<CreateCodeGroupFormValues>({
     resolver: zodResolver(createCodeGroupSchema),
@@ -80,14 +80,20 @@ export function CodeGroupsAddDialog({ onSuccess }: CodeGroupsAddDialogProps) {
             sort: [],
             filters: [],
             joinOperator: "and",
-            flags: []
+            flags: [],
+            code: "",
+            name: "",
+            type: ""
           })
           if (result.data) {
-            setProjects(result.data)
+            // plant 타입의 프로젝트만 필터링
+            const plantProjects = result.data.filter(project => project.type === 'plant')
+            setProjects(plantProjects)
           }
         } catch (error) {
           console.error("Failed to load projects:", error)
           toast.error("프로젝트 목록을 불러오는데 실패했습니다.")
+          
         }
       }
       loadProjects()
-- 
cgit v1.2.3

