From d3ff18a2320eeb400dc5d18588490c775bff4820 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 12 Nov 2025 08:39:01 +0000
Subject: (임수민) GTC 기본계약 코멘트 관련 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/basic-contract/gtc-vendor/preview-document-dialog.tsx | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'lib/basic-contract/gtc-vendor/preview-document-dialog.tsx')

diff --git a/lib/basic-contract/gtc-vendor/preview-document-dialog.tsx b/lib/basic-contract/gtc-vendor/preview-document-dialog.tsx
index c017b8be..444bad59 100644
--- a/lib/basic-contract/gtc-vendor/preview-document-dialog.tsx
+++ b/lib/basic-contract/gtc-vendor/preview-document-dialog.tsx
@@ -39,6 +39,7 @@ interface PreviewDocumentDialogProps
   clauses: GtcClauseTreeView[]
   contractDocument: any
   vendor: Vendor
+  contractId?: number
   onExport?: () => void
 }
 
@@ -46,6 +47,7 @@ export function PreviewDocumentDialog({
   clauses, 
   contractDocument,
   vendor,
+  contractId,
   onExport,
   ...props 
 }: PreviewDocumentDialogProps) {
@@ -234,13 +236,18 @@ export function PreviewDocumentDialog({
       return
     }
 
+    if (!contractId) {
+      toast.error("계약 ID를 찾을 수 없습니다. URL에 contractId 파라미터가 필요합니다.")
+      return
+    }
+
     setIsSaving(true)
     
     try {
-      console.log("💾 문서 저장 시작")
+      console.log("💾 문서 저장 시작", { contractId })
       
       const result = await saveGtcDocumentAction({
-        documentId: contractDocument.id,
+        documentId: contractId,
         pdfBuffer: convertedPdf,
         originalFileName: selectedFile.name,
         vendor
-- 
cgit v1.2.3

