實現完整的後台得獎資訊
This commit is contained in:
@@ -134,7 +134,7 @@ export async function GET(request: NextRequest) {
|
||||
awards = awards.filter(award => award.month === parseInt(month));
|
||||
}
|
||||
|
||||
// 解析 JSON 欄位
|
||||
// 解析 JSON 欄位並統一欄位命名
|
||||
const processedAwards = awards.map(award => {
|
||||
console.log('🔍 處理獎項:', {
|
||||
id: award.id,
|
||||
@@ -145,7 +145,15 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
return {
|
||||
...award,
|
||||
application_links: award.application_links ? JSON.parse(award.application_links) : null,
|
||||
// 統一欄位命名:將下劃線命名轉換為駝峰命名
|
||||
competitionId: award.competition_id,
|
||||
competitionName: (award as any).competition_name,
|
||||
competitionType: (award as any).competition_type,
|
||||
awardName: award.award_name,
|
||||
awardType: award.award_type,
|
||||
teamName: award.team_name,
|
||||
appName: award.app_name,
|
||||
applicationLinks: award.application_links ? JSON.parse(award.application_links) : null,
|
||||
documents: award.documents ? JSON.parse(award.documents) : [],
|
||||
photos: award.photos ? JSON.parse(award.photos) : [],
|
||||
};
|
||||
|
@@ -3,7 +3,7 @@
|
||||
// =====================================================
|
||||
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { AwardService } from '@/lib/services/database-service';
|
||||
import { CompetitionService } from '@/lib/services/database-service';
|
||||
|
||||
// 獲取競賽評審列表
|
||||
export async function GET(
|
||||
@@ -22,7 +22,7 @@ export async function GET(
|
||||
|
||||
console.log('🔍 獲取競賽評審:', competitionId);
|
||||
|
||||
const judges = await AwardService.getCompetitionJudges(competitionId);
|
||||
const judges = await CompetitionService.getCompetitionJudges(competitionId);
|
||||
|
||||
console.log('✅ 獲取到評審數量:', judges?.length || 0);
|
||||
|
||||
|
Reference in New Issue
Block a user