refactor payments module
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import type {
|
||||
IGetPrizesPresenter,
|
||||
GetPrizesResultDTO,
|
||||
GetPrizesViewModel,
|
||||
} from '@core/payments/application/presenters/IGetPrizesPresenter';
|
||||
import type { Presenter } from '@core/shared/presentation/Presenter';
|
||||
import { GetPrizesResultDTO } from '../dtos/GetPrizesDTO';
|
||||
|
||||
export interface IGetPrizesPresenter extends Presenter<GetPrizesResultDTO, GetPrizesResultDTO> {}
|
||||
|
||||
export class GetPrizesPresenter implements IGetPrizesPresenter {
|
||||
private result: GetPrizesViewModel | null = null;
|
||||
private result: GetPrizesResultDTO | null = null;
|
||||
|
||||
reset() {
|
||||
this.result = null;
|
||||
@@ -15,11 +14,11 @@ export class GetPrizesPresenter implements IGetPrizesPresenter {
|
||||
this.result = dto;
|
||||
}
|
||||
|
||||
getViewModel(): GetPrizesViewModel | null {
|
||||
getResponseModel(): GetPrizesResultDTO | null {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
get viewModel(): GetPrizesViewModel {
|
||||
get viewModel(): GetPrizesResultDTO {
|
||||
if (!this.result) throw new Error('Presenter not presented');
|
||||
return this.result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user