website cleanup
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
// Note: No generated DTO available for RequestAvatarGeneration yet
|
||||
interface RequestAvatarGenerationDTO {
|
||||
success: boolean;
|
||||
avatarUrl?: string;
|
||||
error?: string;
|
||||
}
|
||||
import { RequestAvatarGenerationOutputDTO } from '../types/generated/RequestAvatarGenerationOutputDTO';
|
||||
|
||||
/**
|
||||
* Request Avatar Generation View Model
|
||||
@@ -12,13 +7,15 @@ interface RequestAvatarGenerationDTO {
|
||||
*/
|
||||
export class RequestAvatarGenerationViewModel {
|
||||
success: boolean;
|
||||
avatarUrl?: string;
|
||||
error?: string;
|
||||
requestId?: string;
|
||||
avatarUrls?: string[];
|
||||
errorMessage?: string;
|
||||
|
||||
constructor(dto: RequestAvatarGenerationDTO) {
|
||||
constructor(dto: RequestAvatarGenerationOutputDTO) {
|
||||
this.success = dto.success;
|
||||
if (dto.avatarUrl !== undefined) this.avatarUrl = dto.avatarUrl;
|
||||
if (dto.error !== undefined) this.error = dto.error;
|
||||
if (dto.requestId !== undefined) this.requestId = dto.requestId;
|
||||
if (dto.avatarUrls !== undefined) this.avatarUrls = dto.avatarUrls;
|
||||
if (dto.errorMessage !== undefined) this.errorMessage = dto.errorMessage;
|
||||
}
|
||||
|
||||
/** UI-specific: Whether generation was successful */
|
||||
@@ -28,6 +25,11 @@ export class RequestAvatarGenerationViewModel {
|
||||
|
||||
/** UI-specific: Whether there was an error */
|
||||
get hasError(): boolean {
|
||||
return !!this.error;
|
||||
return !!this.errorMessage;
|
||||
}
|
||||
|
||||
/** UI-specific: Get first avatar URL */
|
||||
get firstAvatarUrl(): string | undefined {
|
||||
return this.avatarUrls?.[0];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user