import { IApproveLeagueJoinRequestPresenter, ApproveLeagueJoinRequestResultDTO, ApproveLeagueJoinRequestViewModel } from '@core/racing/application/presenters/IApproveLeagueJoinRequestPresenter';

export class ApproveLeagueJoinRequestPresenter implements IApproveLeagueJoinRequestPresenter {
  private result: ApproveLeagueJoinRequestViewModel | null = null;

  reset() {
    this.result = null;
  }

  present(dto: ApproveLeagueJoinRequestResultDTO) {
    this.result = dto;
  }

  getViewModel(): ApproveLeagueJoinRequestViewModel {
    if (!this.result) throw new Error('Presenter not presented');
    return this.result;
  }
}