website refactor

This commit is contained in:
2026-01-12 01:01:49 +01:00
parent 5ca6023a5a
commit fefd8d1cd6
294 changed files with 4628 additions and 4991 deletions

View File

@@ -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 */