view models
This commit is contained in:
21
apps/website/lib/view-models/CreateLeagueViewModel.ts
Normal file
21
apps/website/lib/view-models/CreateLeagueViewModel.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { CreateLeagueOutputDTO } from '../types/generated/CreateLeagueOutputDTO';
|
||||
|
||||
/**
|
||||
* View Model for Create League Result
|
||||
*
|
||||
* Represents the result of creating a league in a UI-ready format.
|
||||
*/
|
||||
export class CreateLeagueViewModel implements CreateLeagueOutputDTO {
|
||||
leagueId: string;
|
||||
success: boolean;
|
||||
|
||||
constructor(dto: CreateLeagueOutputDTO) {
|
||||
this.leagueId = dto.leagueId;
|
||||
this.success = dto.success;
|
||||
}
|
||||
|
||||
/** UI-specific: Success message */
|
||||
get successMessage(): string {
|
||||
return this.success ? 'League created successfully!' : 'Failed to create league.';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user