Files
gridpilot.gg/apps/website/lib/view-models/UpdateAvatarViewModel.ts
2026-01-23 15:30:23 +01:00

29 lines
678 B
TypeScript

/**
* Update Avatar View Model
*
* Represents the result of an avatar update operation
*/
import { ViewModel } from "../contracts/view-models/ViewModel";
import type { UpdateAvatarViewData } from "../view-data/UpdateAvatarViewData";
export class UpdateAvatarViewModel extends ViewModel {
success: boolean;
error?: string;
constructor(data: UpdateAvatarViewData) {
super();
this.success = data.success;
this.error = data.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;
}
}