refactor
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import type {
|
||||
IDeletePrizePresenter,
|
||||
DeletePrizeResultDTO,
|
||||
DeletePrizeViewModel,
|
||||
} from '@core/payments/application/presenters/IDeletePrizePresenter';
|
||||
|
||||
export class DeletePrizePresenter implements IDeletePrizePresenter {
|
||||
private result: DeletePrizeViewModel | null = null;
|
||||
|
||||
reset() {
|
||||
this.result = null;
|
||||
}
|
||||
|
||||
present(dto: DeletePrizeResultDTO) {
|
||||
this.result = dto;
|
||||
}
|
||||
|
||||
getViewModel(): DeletePrizeViewModel | null {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
get viewModel(): DeletePrizeViewModel {
|
||||
if (!this.result) throw new Error('Presenter not presented');
|
||||
return this.result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user