From f414e1e1dd2f13659e517af77b90c9071b4c14a4 Mon Sep 17 00:00:00 2001 From: merrycoral Date: Wed, 29 Oct 2025 15:13:01 +0900 Subject: [PATCH] =?UTF-8?q?=ED=83=80=EC=9E=85=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EB=B9=8C=EB=93=9C=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - EventObjective 타입 명시적으로 지정 - recommendation 중첩 구조에 맞게 속성 접근 수정 - 빌드 성공 확인 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/app/(main)/events/create/steps/ApprovalStep.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/(main)/events/create/steps/ApprovalStep.tsx b/src/app/(main)/events/create/steps/ApprovalStep.tsx index ac21541..b14e5fa 100644 --- a/src/app/(main)/events/create/steps/ApprovalStep.tsx +++ b/src/app/(main)/events/create/steps/ApprovalStep.tsx @@ -21,6 +21,7 @@ import { ArrowBack, CheckCircle, Edit, RocketLaunch, Save, People, AttachMoney, import { EventData } from '../page'; import { cardStyles, colors, responsiveText } from '@/shared/lib/button-styles'; import { eventApi } from '@/entities/event/api/eventApi'; +import type { EventObjective } from '@/entities/event/model/types'; interface ApprovalStepProps { eventData: EventData; @@ -44,14 +45,14 @@ export default function ApprovalStep({ eventData, onApprove, onBack }: ApprovalS console.log('📞 Creating event with objective:', eventData.objective); // objective 매핑 (Frontend → Backend) - const objectiveMap: Record = { + const objectiveMap: Record = { 'new_customer': 'CUSTOMER_ACQUISITION', 'revisit': 'Customer Retention', 'sales': 'Sales Promotion', 'awareness': 'awareness', }; - const backendObjective = objectiveMap[eventData.objective || 'new_customer'] || 'CUSTOMER_ACQUISITION'; + const backendObjective: EventObjective = (objectiveMap[eventData.objective || 'new_customer'] || 'CUSTOMER_ACQUISITION') as EventObjective; const createResponse = await eventApi.createEvent({ objective: backendObjective, @@ -67,7 +68,7 @@ export default function ApprovalStep({ eventData, onApprove, onBack }: ApprovalS console.log('📞 Updating event details:', eventId); // 이벤트명 가져오기 (contentEdit.title 또는 recommendation.title) - const eventName = eventData.contentEdit?.title || eventData.recommendation?.title || '이벤트'; + const eventName = eventData.contentEdit?.title || eventData.recommendation?.recommendation?.title || '이벤트'; // 날짜 설정 (오늘부터 30일간) const today = new Date(); @@ -79,7 +80,7 @@ export default function ApprovalStep({ eventData, onApprove, onBack }: ApprovalS await eventApi.updateEvent(eventId, { eventName: eventName, - description: eventData.contentEdit?.guide || eventData.recommendation?.participationMethod, + description: eventData.contentEdit?.guide || eventData.recommendation?.recommendation?.description || '', startDate: startDateStr, endDate: endDateStr, });