website cleanup

This commit is contained in:
2025-12-25 00:19:36 +01:00
parent d78854a4c6
commit 9486455b9e
82 changed files with 1223 additions and 363 deletions

View File

@@ -27,10 +27,44 @@ export class RaceStewardingService {
this.penaltiesApiClient.getRacePenalties(raceId),
]);
// Convert API responses to match RaceStewardingViewModel expectations
const convertedProtests = {
protests: protests.protests.map(p => ({
id: p.id,
protestingDriverId: p.protestingDriverId,
accusedDriverId: p.accusedDriverId,
incident: {
lap: p.lap,
description: p.description
},
filedAt: p.filedAt,
status: p.status
})),
driverMap: Object.entries(protests.driverMap).reduce((acc, [id, name]) => {
acc[id] = { id, name: name as string };
return acc;
}, {} as Record<string, { id: string; name: string }>)
};
const convertedPenalties = {
penalties: penalties.penalties.map(p => ({
id: p.id,
driverId: p.driverId,
type: p.type,
value: p.value,
reason: p.reason,
notes: p.notes
})),
driverMap: Object.entries(penalties.driverMap).reduce((acc, [id, name]) => {
acc[id] = { id, name: name as string };
return acc;
}, {} as Record<string, { id: string; name: string }>)
};
return new RaceStewardingViewModel({
raceDetail,
protests,
penalties,
protests: convertedProtests,
penalties: convertedPenalties,
});
}
}