From 2650b7c0bb0ea12b68a58c0439f72d61df04b2f1 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 25 Jul 2025 07:51:15 +0000
Subject: (대표님) 정기평가 대상, 미들웨어 수정, nextauth 토큰 처리 개선, GTC
 등 (최겸) 기술영업
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/gtc-contract/status/delete-gtc-documents-dialog.tsx | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'lib/gtc-contract/status/delete-gtc-documents-dialog.tsx')

diff --git a/lib/gtc-contract/status/delete-gtc-documents-dialog.tsx b/lib/gtc-contract/status/delete-gtc-documents-dialog.tsx
index 5779a2b6..50c8d3f4 100644
--- a/lib/gtc-contract/status/delete-gtc-documents-dialog.tsx
+++ b/lib/gtc-contract/status/delete-gtc-documents-dialog.tsx
@@ -29,6 +29,7 @@ import {
 } from "@/components/ui/drawer"
 
 import { deleteGtcDocuments } from "@/lib/gtc-contract/service"
+import { useSession } from "next-auth/react"
 import { type GtcDocumentWithRelations } from "@/db/schema/gtc"
 
 interface DeleteGtcDocumentsDialogProps
@@ -46,11 +47,18 @@ export function DeleteGtcDocumentsDialog({
 }: DeleteGtcDocumentsDialogProps) {
   const [isDeletePending, startDeleteTransition] = React.useTransition()
   const isDesktop = useMediaQuery("(min-width: 640px)")
+  const { data: session } = useSession()
 
   function onDelete() {
+    if (!session?.user?.id) {
+      toast.error("로그인이 필요합니다.")
+      return
+    }
+  
     startDeleteTransition(async () => {
       const { error } = await deleteGtcDocuments({
         ids: gtcDocuments.map((doc) => doc.id),
+        updatedById: Number(session.user.id) 
       })
 
       if (error) {
-- 
cgit v1.2.3

