resolve manual DTOs
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { LeagueStandingDTO } from '../types/generated/LeagueStandingDTO';
|
||||
import { StandingEntryViewModel } from './StandingEntryViewModel';
|
||||
import { DriverDTO } from '../types/DriverDTO';
|
||||
import { GetDriverOutputDTO } from '../types/generated/GetDriverOutputDTO';
|
||||
import { LeagueMembership } from '../types/LeagueMembership';
|
||||
|
||||
export class LeagueStandingsViewModel {
|
||||
standings: StandingEntryViewModel[];
|
||||
drivers: DriverDTO[];
|
||||
drivers: GetDriverOutputDTO[];
|
||||
memberships: LeagueMembership[];
|
||||
|
||||
constructor(dto: { standings: LeagueStandingDTO[]; drivers: DriverDTO[]; memberships: LeagueMembership[] }, currentUserId: string, previousStandings?: LeagueStandingDTO[]) {
|
||||
constructor(dto: { standings: LeagueStandingDTO[]; drivers: GetDriverOutputDTO[]; memberships: LeagueMembership[] }, currentUserId: string, previousStandings?: LeagueStandingDTO[]) {
|
||||
const leaderPoints = dto.standings[0]?.points || 0;
|
||||
this.standings = dto.standings.map((entry, index) => {
|
||||
const nextPoints = dto.standings[index + 1]?.points || entry.points;
|
||||
|
||||
Reference in New Issue
Block a user