From c228a89c2834ee63b209bad608837c39643f350e Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 28 Jul 2025 11:44:16 +0000
Subject: (대표님) 의존성 docx 추가, basicContract API, gtc(계약일반조건),
 벤더평가 esg 평가데이터 내보내기 개선, S-EDP 피드백 대응(CLS_ID, ITEM NO 등)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../status/update-gtc-document-sheet.tsx           | 34 ++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

(limited to 'lib/gtc-contract/status/update-gtc-document-sheet.tsx')

diff --git a/lib/gtc-contract/status/update-gtc-document-sheet.tsx b/lib/gtc-contract/status/update-gtc-document-sheet.tsx
index 9d133ecc..6ba02a44 100644
--- a/lib/gtc-contract/status/update-gtc-document-sheet.tsx
+++ b/lib/gtc-contract/status/update-gtc-document-sheet.tsx
@@ -19,16 +19,19 @@ import { Button } from "@/components/ui/button"
 import {
   Form,
   FormControl,
+  FormDescription,
   FormField,
   FormItem,
   FormLabel,
   FormMessage,
 } from "@/components/ui/form"
 import { Textarea } from "@/components/ui/textarea"
+import { useRouter } from "next/navigation";
 
 import { type GtcDocumentWithRelations } from "@/db/schema/gtc"
 import { updateGtcDocumentSchema, type UpdateGtcDocumentSchema } from "@/lib/gtc-contract/validations"
 import { updateGtcDocument } from "@/lib/gtc-contract/service"
+import { Input } from "@/components/ui/input"
 
 export interface UpdateGtcDocumentSheetProps
   extends React.ComponentPropsWithRef<typeof Sheet> {
@@ -37,11 +40,13 @@ export interface UpdateGtcDocumentSheetProps
 
 export function UpdateGtcDocumentSheet({ gtcDocument, ...props }: UpdateGtcDocumentSheetProps) {
   const [isUpdatePending, startUpdateTransition] = React.useTransition()
-  
+  const router = useRouter();
+
   const form = useForm<UpdateGtcDocumentSchema>({
     resolver: zodResolver(updateGtcDocumentSchema),
     defaultValues: {
       editReason: "",
+      title: "",
       isActive: gtcDocument?.isActive ?? true,
     },
   })
@@ -50,7 +55,8 @@ export function UpdateGtcDocumentSheet({ gtcDocument, ...props }: UpdateGtcDocum
   React.useEffect(() => {
     if (gtcDocument) {
       form.reset({
-        editReason: "",
+        editReason: gtcDocument.editReason,
+        title:gtcDocument.title,
         isActive: gtcDocument.isActive,
       })
     }
@@ -70,6 +76,8 @@ export function UpdateGtcDocumentSheet({ gtcDocument, ...props }: UpdateGtcDocum
 
         form.reset()
         props.onOpenChange?.(false)
+        router.refresh();
+
         toast.success("GTC 문서가 업데이트되었습니다!")
       } catch (error) {
         toast.error("문서 업데이트 중 오류가 발생했습니다.")
@@ -104,6 +112,28 @@ export function UpdateGtcDocumentSheet({ gtcDocument, ...props }: UpdateGtcDocum
               </div>
             </div>
 
+
+            <FormField
+              control={form.control}
+              name="title"
+              render={({ field }) => (
+                <FormItem>
+                  <FormLabel>GTC 제목 (선택사항)</FormLabel>
+                  <FormControl>
+                    <Input
+                      placeholder="GTC 제목를 입력하세요..."
+                      {...field}
+                    />
+                  </FormControl>
+                  <FormDescription>
+                    워드의 제목으로 사용됩니다.
+                  </FormDescription>
+                  <FormMessage />
+                </FormItem>
+              )}
+            />
+
+
             {/* 편집 사유 */}
             <FormField
               control={form.control}
-- 
cgit v1.2.3

