From ee57cc221ff2edafd3c0f12a181214c602ed257e Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Tue, 22 Jul 2025 02:57:00 +0000
Subject: (대표님, 최겸) 이메일 템플릿, 벤더데이터 변경사항 대응, 기술영업
 변경요구사항 구현
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/email-template/editor/template-content-editor.tsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'lib/email-template/editor/template-content-editor.tsx')

diff --git a/lib/email-template/editor/template-content-editor.tsx b/lib/email-template/editor/template-content-editor.tsx
index 4d31753c..08de53d2 100644
--- a/lib/email-template/editor/template-content-editor.tsx
+++ b/lib/email-template/editor/template-content-editor.tsx
@@ -167,7 +167,7 @@ export function TemplateContentEditor({ template, onUpdate }: TemplateContentEdi
                     subject,
                     content,
                     sampleData,
-                    version: template.version + 1
+                    version: template.version ? template.version + 1 :0
                 })
             } else {
                 toast.error(result.error || '저장에 실패했습니다.')
@@ -188,12 +188,13 @@ export function TemplateContentEditor({ template, onUpdate }: TemplateContentEdi
                 template.slug,
                 sampleData,
                 content,
-                // subject // 주석 해제
+                subject // 주석 해제
             )
 
-            if (result.success) {
+
+            if (result.success && result.data) {
                 setPreviewHtml(result.data.html)
-                setPreviewSubject(result.data.subject)
+                setPreviewSubject(result.data.subjectHtml)
                 if (!silent) toast.success('미리보기가 생성되었습니다.')
             } else {
                 if (!silent) toast.error(result.error || '미리보기 생성에 실패했습니다.')
-- 
cgit v1.2.3

