view data fixes
This commit is contained in:
@@ -1,22 +1,21 @@
|
||||
// Note: No generated DTO available for DeleteMedia yet
|
||||
interface DeleteMediaDTO {
|
||||
success: boolean;
|
||||
error?: string;
|
||||
}
|
||||
import type { DeleteMediaViewData } from '@/lib/builders/view-data/DeleteMediaViewData';
|
||||
import { ViewModel } from '../contracts/view-models/ViewModel';
|
||||
|
||||
/**
|
||||
* Delete Media View Model
|
||||
*
|
||||
* Represents the result of a media deletion operation
|
||||
* Composes ViewData for UI consumption.
|
||||
*/
|
||||
export class DeleteMediaViewModel {
|
||||
export class DeleteMediaViewModel extends ViewModel {
|
||||
success: boolean;
|
||||
error?: string;
|
||||
|
||||
constructor(dto: DeleteMediaDTO) {
|
||||
this.success = dto.success;
|
||||
if (dto.error !== undefined) {
|
||||
this.error = dto.error;
|
||||
constructor(viewData: DeleteMediaViewData) {
|
||||
super();
|
||||
this.success = viewData.success;
|
||||
if (viewData.error !== undefined) {
|
||||
this.error = viewData.error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user