mirror of
https://github.com/ktds-dg0501/kt-event-marketing-fe.git
synced 2025-12-06 18:06:24 +00:00
타입 에러 수정 및 빌드 오류 해결
- EventObjective 타입 명시적으로 지정 - recommendation 중첩 구조에 맞게 속성 접근 수정 - 빌드 성공 확인 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
1e462c41c0
commit
f414e1e1dd
@ -21,6 +21,7 @@ import { ArrowBack, CheckCircle, Edit, RocketLaunch, Save, People, AttachMoney,
|
|||||||
import { EventData } from '../page';
|
import { EventData } from '../page';
|
||||||
import { cardStyles, colors, responsiveText } from '@/shared/lib/button-styles';
|
import { cardStyles, colors, responsiveText } from '@/shared/lib/button-styles';
|
||||||
import { eventApi } from '@/entities/event/api/eventApi';
|
import { eventApi } from '@/entities/event/api/eventApi';
|
||||||
|
import type { EventObjective } from '@/entities/event/model/types';
|
||||||
|
|
||||||
interface ApprovalStepProps {
|
interface ApprovalStepProps {
|
||||||
eventData: EventData;
|
eventData: EventData;
|
||||||
@ -44,14 +45,14 @@ export default function ApprovalStep({ eventData, onApprove, onBack }: ApprovalS
|
|||||||
console.log('📞 Creating event with objective:', eventData.objective);
|
console.log('📞 Creating event with objective:', eventData.objective);
|
||||||
|
|
||||||
// objective 매핑 (Frontend → Backend)
|
// objective 매핑 (Frontend → Backend)
|
||||||
const objectiveMap: Record<string, string> = {
|
const objectiveMap: Record<string, EventObjective> = {
|
||||||
'new_customer': 'CUSTOMER_ACQUISITION',
|
'new_customer': 'CUSTOMER_ACQUISITION',
|
||||||
'revisit': 'Customer Retention',
|
'revisit': 'Customer Retention',
|
||||||
'sales': 'Sales Promotion',
|
'sales': 'Sales Promotion',
|
||||||
'awareness': 'awareness',
|
'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({
|
const createResponse = await eventApi.createEvent({
|
||||||
objective: backendObjective,
|
objective: backendObjective,
|
||||||
@ -67,7 +68,7 @@ export default function ApprovalStep({ eventData, onApprove, onBack }: ApprovalS
|
|||||||
console.log('📞 Updating event details:', eventId);
|
console.log('📞 Updating event details:', eventId);
|
||||||
|
|
||||||
// 이벤트명 가져오기 (contentEdit.title 또는 recommendation.title)
|
// 이벤트명 가져오기 (contentEdit.title 또는 recommendation.title)
|
||||||
const eventName = eventData.contentEdit?.title || eventData.recommendation?.title || '이벤트';
|
const eventName = eventData.contentEdit?.title || eventData.recommendation?.recommendation?.title || '이벤트';
|
||||||
|
|
||||||
// 날짜 설정 (오늘부터 30일간)
|
// 날짜 설정 (오늘부터 30일간)
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
@ -79,7 +80,7 @@ export default function ApprovalStep({ eventData, onApprove, onBack }: ApprovalS
|
|||||||
|
|
||||||
await eventApi.updateEvent(eventId, {
|
await eventApi.updateEvent(eventId, {
|
||||||
eventName: eventName,
|
eventName: eventName,
|
||||||
description: eventData.contentEdit?.guide || eventData.recommendation?.participationMethod,
|
description: eventData.contentEdit?.guide || eventData.recommendation?.recommendation?.description || '',
|
||||||
startDate: startDateStr,
|
startDate: startDateStr,
|
||||||
endDate: endDateStr,
|
endDate: endDateStr,
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user