view data fixes
This commit is contained in:
@@ -1,21 +1,18 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
import type { GetTeamsLeaderboardOutputDTO } from '@/lib/types/generated/GetTeamsLeaderboardOutputDTO';
|
||||
import type { TeamRankingsViewData } from '@/lib/view-data/TeamRankingsViewData';
|
||||
|
||||
export class TeamRankingsViewDataBuilder {
|
||||
static build(apiDto: GetTeamsLeaderboardOutputDTO): TeamRankingsViewData {
|
||||
const allTeams = apiDto.teams.map((team, index) => ({
|
||||
id: team.id,
|
||||
name: team.name,
|
||||
tag: team.tag,
|
||||
memberCount: team.memberCount,
|
||||
category: undefined,
|
||||
totalWins: team.totalWins || 0,
|
||||
logoUrl: team.logoUrl || '',
|
||||
position: index + 1,
|
||||
isRecruiting: team.isRecruiting,
|
||||
performanceLevel: team.performanceLevel || 'N/A',
|
||||
rating: team.rating || 0,
|
||||
totalRaces: team.totalRaces || 0,
|
||||
import { ViewDataBuilder } from "../../contracts/builders/ViewDataBuilder";
|
||||
|
||||
export class TeamRankingsViewDataBuilder implements ViewDataBuilder<any, any> {
|
||||
build(input: any): any {
|
||||
return TeamRankingsViewDataBuilder.build(input);
|
||||
}
|
||||
|
||||
static build(
|
||||
public static build(apiDto: GetTeamsLeaderboardOutputDTO): TeamRankingsViewData {
|
||||
const allTeams = apiDto.teams.map(t => ({
|
||||
...t,
|
||||
}));
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user