25 lines
791 B
TypeScript
25 lines
791 B
TypeScript
import { RacesApiClient } from '@/lib/api/races/RacesApiClient';
|
|
|
|
/**
|
|
* Race Service - DTO Only
|
|
*
|
|
* Returns raw API DTOs. No ViewModels or UX logic.
|
|
* All client-side presentation logic must be handled by hooks/components.
|
|
*/
|
|
export class RaceService {
|
|
constructor(private readonly apiClient: RacesApiClient) {}
|
|
|
|
async getRaceById(raceId: string): Promise<any> {
|
|
// This would need a driverId, but for now we'll use a placeholder
|
|
return this.apiClient.getDetail(raceId, 'placeholder-driver-id');
|
|
}
|
|
|
|
async getRacesByLeagueId(leagueId: string): Promise<any> {
|
|
return this.apiClient.getPageData(leagueId);
|
|
}
|
|
|
|
async findByLeagueId(leagueId: string): Promise<any[]> {
|
|
const result = await this.apiClient.getPageData(leagueId);
|
|
return result.races || [];
|
|
}
|
|
} |