23 lines
743 B
TypeScript
23 lines
743 B
TypeScript
import { api as api } from '../../api';
|
|
import { presentRaceResultsDetail } from '../../presenters';
|
|
import { RaceResultsDetailViewModel } from '../../view-models';
|
|
|
|
export async function getRaceResults(
|
|
raceId: string,
|
|
currentUserId?: string
|
|
): Promise<RaceResultsDetailViewModel> {
|
|
const dto = await api.races.getResultsDetail(raceId);
|
|
return presentRaceResultsDetail(dto, currentUserId);
|
|
}
|
|
|
|
export async function getRaceSOF(raceId: string): Promise<any> {
|
|
const dto = await api.races.getWithSOF(raceId);
|
|
// TODO: use presenter
|
|
return dto;
|
|
}
|
|
|
|
export async function importRaceResults(raceId: string, input: any): Promise<any> {
|
|
const dto = await api.races.importResults(raceId, input);
|
|
// TODO: use presenter
|
|
return dto;
|
|
} |