Files
gridpilot.gg/apps/website/lib/services/races/RaceService.ts
2025-12-17 18:01:47 +01:00

22 lines
610 B
TypeScript

import { api as api } from '../../api';
import { presentRaceDetail } from '../../presenters';
import { RaceDetailViewModel } from '../../view-models';
export async function getRaceDetail(
raceId: string,
driverId: string
): Promise<RaceDetailViewModel> {
const dto = await api.races.getDetail(raceId, driverId);
return presentRaceDetail(dto);
}
export async function getRacesPageData(): Promise<any> {
const dto = await api.races.getPageData();
// TODO: use presenter
return dto;
}
export async function getRacesTotal(): Promise<any> {
const dto = await api.races.getTotal();
return dto;
}