website cleanup
This commit is contained in:
19
apps/website/lib/view-models/RaceDetailEntryViewModel.ts
Normal file
19
apps/website/lib/view-models/RaceDetailEntryViewModel.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { RaceDetailEntryDTO } from '../types/generated/RaceDetailEntryDTO';
|
||||
|
||||
export class RaceDetailEntryViewModel {
|
||||
id: string;
|
||||
name: string;
|
||||
country: string;
|
||||
avatarUrl: string;
|
||||
isCurrentUser: boolean;
|
||||
rating: number | null;
|
||||
|
||||
constructor(dto: RaceDetailEntryDTO, currentDriverId: string, rating?: number) {
|
||||
this.id = dto.id;
|
||||
this.name = dto.name;
|
||||
this.country = dto.country;
|
||||
this.avatarUrl = dto.avatarUrl;
|
||||
this.isCurrentUser = dto.id === currentDriverId;
|
||||
this.rating = rating ?? null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user