view data fixes
This commit is contained in:
@@ -37,7 +37,11 @@ export class RaceResultsService implements Service {
|
||||
const res = await this.getRaceResultsDetail(raceId);
|
||||
if (res.isErr()) throw new Error((res as any).error.message);
|
||||
const data = (res as any).value;
|
||||
return new RaceResultsDetailViewModel(data, (currentUserId === undefined || currentUserId === null) ? '' : currentUserId);
|
||||
return new RaceResultsDetailViewModel({
|
||||
...data,
|
||||
currentUserId: currentUserId ?? '',
|
||||
results: data.results || [],
|
||||
});
|
||||
}
|
||||
|
||||
async importResults(raceId: string, input: any): Promise<any> {
|
||||
|
||||
@@ -47,20 +47,7 @@ export class RaceStewardingService implements Service {
|
||||
const res = await this.getRaceStewarding(raceId, driverId);
|
||||
if (res.isErr()) throw new Error((res as any).error.message);
|
||||
const data = (res as any).value;
|
||||
return new RaceStewardingViewModel({
|
||||
raceDetail: {
|
||||
race: data.race,
|
||||
league: data.league,
|
||||
},
|
||||
protests: {
|
||||
protests: data.protests,
|
||||
driverMap: data.driverMap,
|
||||
},
|
||||
penalties: {
|
||||
penalties: data.penalties,
|
||||
driverMap: data.driverMap,
|
||||
},
|
||||
} as any);
|
||||
return new RaceStewardingViewModel(data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user