22 lines
610 B
TypeScript
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;
|
|
} |