website refactor
This commit is contained in:
@@ -2,7 +2,7 @@ import { Result } from '@/lib/contracts/Result';
|
||||
import { PageQuery } from '@/lib/contracts/page-queries/PageQuery';
|
||||
import { PresentationError, mapToPresentationError } from '@/lib/contracts/page-queries/PresentationError';
|
||||
import { TeamService } from '@/lib/services/teams/TeamService';
|
||||
import type { TeamSummaryViewModel } from '@/lib/view-models/TeamSummaryViewModel';
|
||||
import { TeamSummaryViewModel } from '@/lib/view-models/TeamSummaryViewModel';
|
||||
|
||||
export interface TeamLeaderboardPageData {
|
||||
teams: TeamSummaryViewModel[];
|
||||
@@ -18,15 +18,7 @@ export class TeamLeaderboardPageQuery implements PageQuery<TeamLeaderboardPageDa
|
||||
return Result.err(mapToPresentationError(result.getError()));
|
||||
}
|
||||
|
||||
const teams = result.unwrap().map((t: any) => ({
|
||||
id: t.id,
|
||||
name: t.name,
|
||||
logoUrl: t.logoUrl,
|
||||
memberCount: t.memberCount,
|
||||
totalWins: t.totalWins,
|
||||
totalRaces: t.totalRaces,
|
||||
rating: 1450, // Mocked as in original
|
||||
} as TeamSummaryViewModel));
|
||||
const teams = result.unwrap().map((t: any) => new TeamSummaryViewModel(t));
|
||||
|
||||
return Result.ok({ teams });
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user