타입 에러 수정 및 빌드 오류 해결

- EventObjective 타입 명시적으로 지정
- recommendation 중첩 구조에 맞게 속성 접근 수정
- 빌드 성공 확인

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
merrycoral 2025-10-29 15:13:01 +09:00
parent 1e462c41c0
commit f414e1e1dd

View File

@ -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<string, string> = {
const objectiveMap: Record<string, EventObjective> = {
'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,
});