view data fixes

This commit is contained in:
2026-01-23 15:30:23 +01:00
parent e22033be38
commit f8099f04bc
213 changed files with 3466 additions and 3003 deletions

View File

@@ -1,18 +1,9 @@
import type { TeamListItemDTO } from '@/lib/types/generated/TeamListItemDTO';
interface TeamCardDTO {
id: string;
name: string;
tag: string;
description: string;
logoUrl?: string;
}
/**
* Team card view model
* UI representation of a team on the landing page.
*/
import { ViewModel } from "../contracts/view-models/ViewModel";
import type { TeamCardViewData } from "@/lib/view-data/TeamCardViewData";
export class TeamCardViewModel extends ViewModel {
readonly id: string;
@@ -21,11 +12,12 @@ export class TeamCardViewModel extends ViewModel {
readonly description: string;
readonly logoUrl?: string;
constructor(dto: TeamCardDTO | TeamListItemDTO) {
this.id = dto.id;
this.name = dto.name;
this.tag = dto.tag;
this.description = dto.description;
this.logoUrl = 'logoUrl' in dto ? dto.logoUrl : undefined;
constructor(data: TeamCardViewData) {
super();
this.id = data.id;
this.name = data.name;
this.tag = data.tag;
this.description = data.description;
this.logoUrl = data.logoUrl;
}
}