From ed864fa46c7ce0aac2de4c5ba5d311ebfd7e6a88 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Thu, 15 May 2025 01:34:49 +0000
Subject: (대표님) 벤더 문서 관련 개발사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/vendor-data/sidebar.tsx | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'components/vendor-data/sidebar.tsx')

diff --git a/components/vendor-data/sidebar.tsx b/components/vendor-data/sidebar.tsx
index 2dff6bc1..3805d216 100644
--- a/components/vendor-data/sidebar.tsx
+++ b/components/vendor-data/sidebar.tsx
@@ -24,6 +24,8 @@ interface SidebarProps extends React.HTMLAttributes<HTMLDivElement> {
   isCollapsed: boolean
   packages: PackageData[]
   selectedPackageId: number | null
+  selectedProjectId: number | null
+  selectedContractId: number | null
   onSelectPackage: (itemId: number) => void
   forms: FormInfo[]
   selectedForm: string | null
@@ -37,6 +39,8 @@ export function Sidebar({
   isCollapsed,
   packages,
   selectedPackageId,
+  selectedProjectId,
+  selectedContractId,
   onSelectPackage,
   forms,
   selectedForm,
@@ -48,6 +52,7 @@ export function Sidebar({
   const rawPathname = usePathname()
   const pathname = rawPathname ?? ""
 
+ 
   /**
    * ---------------------------
    * 1) URL에서 현재 패키지 / 폼 코드 추출
@@ -105,7 +110,7 @@ export function Sidebar({
 
     if (mode === "ENG") {
       // ENG 모드에서는 첫 번째 패키지 ID 또는 현재 URL에서 추출한 ID 사용
-      packageId = currentItemId || (packages[0]?.itemId || 0);
+      packageId = 0;
     } else {
       // IM 모드에서는 반드시 선택된 패키지 ID 필요
       if (selectedPackageId === null) return;
@@ -119,7 +124,7 @@ export function Sidebar({
     // 예: /vendor-data/form/[packageId]/[formCode]
     const baseSegments = segments.slice(0, segments.indexOf("vendor-data") + 1).join("/")
     // 모드 정보를 쿼리 파라미터로 추가
-    router.push(`/${baseSegments}/form/${packageId}/${form.formCode}?mode=${mode}`)
+    router.push(`/${baseSegments}/form/${packageId}/${form.formCode}/${selectedProjectId}/${selectedContractId}?mode=${mode}`)
   }
 
   return (
-- 
cgit v1.2.3

