fix data flow issues
This commit is contained in:
26
apps/website/lib/view-models/TeamCardViewModel.ts
Normal file
26
apps/website/lib/view-models/TeamCardViewModel.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { TeamListItemDTO } from '@/lib/types/generated/GetAllTeamsOutputDTO';
|
||||
|
||||
interface TeamCardDTO {
|
||||
id: string;
|
||||
name: string;
|
||||
tag: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Team card view model
|
||||
* UI representation of a team on the landing page.
|
||||
*/
|
||||
export class TeamCardViewModel {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly tag: string;
|
||||
readonly description: string;
|
||||
|
||||
constructor(dto: TeamCardDTO | TeamListItemDTO) {
|
||||
this.id = dto.id;
|
||||
this.name = dto.name;
|
||||
this.tag = dto.tag;
|
||||
this.description = dto.description;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user