website refactor
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { RaceDTO } from '../types/generated/RaceDTO';
|
||||
import { RacesPageDataRaceDTO } from '../types/generated/RacesPageDataRaceDTO';
|
||||
import { RaceDTO } from '@/lib/types/generated/RaceDTO';
|
||||
import { RacesPageDataRaceDTO } from '@/lib/types/generated/RacesPageDataRaceDTO';
|
||||
|
||||
export class RaceViewModel {
|
||||
constructor(
|
||||
@@ -31,15 +31,15 @@ export class RaceViewModel {
|
||||
}
|
||||
|
||||
get track(): string {
|
||||
return (this.dto as any).track || '';
|
||||
return 'track' in this.dto ? this.dto.track || '' : '';
|
||||
}
|
||||
|
||||
get car(): string {
|
||||
return (this.dto as any).car || '';
|
||||
return 'car' in this.dto ? this.dto.car || '' : '';
|
||||
}
|
||||
|
||||
get status(): string | undefined {
|
||||
return this._status || (this.dto as any).status;
|
||||
return this._status || ('status' in this.dto ? this.dto.status : undefined);
|
||||
}
|
||||
|
||||
get registeredCount(): number | undefined {
|
||||
@@ -47,7 +47,7 @@ export class RaceViewModel {
|
||||
}
|
||||
|
||||
get strengthOfField(): number | undefined {
|
||||
return this._strengthOfField || (this.dto as any).strengthOfField;
|
||||
return this._strengthOfField || ('strengthOfField' in this.dto ? this.dto.strengthOfField : undefined);
|
||||
}
|
||||
|
||||
/** UI-specific: Formatted date */
|
||||
|
||||
Reference in New Issue
Block a user