Files
gridpilot.gg/apps/website/lib/view-models/UpdateAvatarViewModel.ts
Marc Mintel d97f50ed72
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 6m4s
Contract Testing / contract-snapshot (pull_request) Has been skipped
view data fixes
2026-01-23 11:59:49 +01:00

32 lines
732 B
TypeScript

// Note: No generated DTO available for UpdateAvatar yet
interface UpdateAvatarDTO {
success: boolean;
error?: string;
}
/**
* Update Avatar View Model
*
* Represents the result of an avatar update operation
*/
import { ViewModel } from "../contracts/view-models/ViewModel";
export class UpdateAvatarViewModel extends ViewModel {
success: boolean;
error?: string;
constructor(dto: UpdateAvatarDTO) {
this.success = dto.success;
if (dto.error !== undefined) this.error = dto.error;
}
/** UI-specific: Whether update was successful */
get isSuccessful(): boolean {
return this.success;
}
/** UI-specific: Whether there was an error */
get hasError(): boolean {
return !!this.error;
}
}