From 8b23b471638a155fd1bfa3a8c853b26d9315b272 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 26 Sep 2025 09:57:24 +0000
Subject: (대표님) 권한관리, 문서업로드, rfq첨부, SWP문서룰 등 (최겸) 입찰
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/email-template/table/create-template-sheet.tsx | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

(limited to 'lib/email-template/table/create-template-sheet.tsx')

diff --git a/lib/email-template/table/create-template-sheet.tsx b/lib/email-template/table/create-template-sheet.tsx
index 199e20ab..1997cae8 100644
--- a/lib/email-template/table/create-template-sheet.tsx
+++ b/lib/email-template/table/create-template-sheet.tsx
@@ -65,12 +65,6 @@ export function CreateTemplateSheet({ ...props }: CreateTemplateSheetProps) {
     const router = useRouter()
     const { data: session } = useSession();
 
-    // 또는 더 안전하게
-    if (!session?.user?.id) {
-        toast.error("로그인이 필요합니다")
-        return
-    }
-
     const form = useForm<CreateTemplateSchema>({
         resolver: zodResolver(createTemplateSchema),
         defaultValues: {
@@ -82,8 +76,8 @@ export function CreateTemplateSheet({ ...props }: CreateTemplateSheetProps) {
     })
 
     // 이름 입력 시 자동으로 slug 생성
-    const watchedName = form.watch("name")
     React.useEffect(() => {
+        const watchedName = form.watch("name")
         if (watchedName && !form.formState.dirtyFields.slug) {
             const autoSlug = watchedName
                 .toLowerCase()
@@ -95,7 +89,7 @@ export function CreateTemplateSheet({ ...props }: CreateTemplateSheetProps) {
 
             form.setValue("slug", autoSlug, { shouldValidate: false })
         }
-    }, [watchedName, form])
+    }, [form])
 
     // 기본 템플릿 내용 생성
     const getDefaultContent = (category: string, name: string) => {
-- 
cgit v1.2.3

