cherry2250 974961e1bd 이벤트 목록 Mock 데이터 적용 및 Participation API 연동
- 이벤트 목록 페이지에 Mock 데이터 적용 (evt_2025012301 등 4개 이벤트)
- 이벤트 상세 페이지 Analytics API 임시 주석처리 (서버 이슈)
- Participation API 프록시 라우트 URL 구조 수정 (/events/ 제거)
- EventID localStorage 저장 기능 추가
- 상세한 console.log 추가 (생성된 eventId, objective, timestamp)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 20:17:09 +09:00

59 lines
1.5 KiB
TypeScript

import { NextRequest, NextResponse } from 'next/server';
const GATEWAY_HOST = 'http://kt-event-marketing-api.20.214.196.128.nip.io';
export async function POST(
request: NextRequest,
{ params }: { params: { eventId: string } }
) {
try {
const { eventId } = params;
const token = request.headers.get('Authorization');
const body = await request.json();
console.log('🎰 [Proxy] Draw winners request:', {
eventId,
hasToken: !!token,
timestamp: new Date().toISOString(),
});
if (!token) {
return NextResponse.json(
{ message: '인증 토큰이 필요합니다.' },
{ status: 401 }
);
}
const response = await fetch(
`${GATEWAY_HOST}/api/v1/participations/events/${eventId}/draw-winners`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: token,
},
body: JSON.stringify(body),
}
);
const data = await response.json();
console.log('📥 [Proxy] Draw winners response:', {
status: response.status,
success: response.ok,
});
if (!response.ok) {
return NextResponse.json(data, { status: response.status });
}
return NextResponse.json(data);
} catch (error) {
console.error('❌ [Proxy] Draw winners error:', error);
return NextResponse.json(
{ message: '당첨자 추첨 중 오류가 발생했습니다.' },
{ status: 500 }
);
}
}