18 lines
628 B
TypeScript
18 lines
628 B
TypeScript
import { IGetLeagueOwnerSummaryPresenter, GetLeagueOwnerSummaryResultDTO, GetLeagueOwnerSummaryViewModel } from '@gridpilot/racing/application/presenters/IGetLeagueOwnerSummaryPresenter';
|
|
|
|
export class GetLeagueOwnerSummaryPresenter implements IGetLeagueOwnerSummaryPresenter {
|
|
private result: GetLeagueOwnerSummaryViewModel | null = null;
|
|
|
|
reset() {
|
|
this.result = null;
|
|
}
|
|
|
|
present(dto: GetLeagueOwnerSummaryResultDTO) {
|
|
this.result = { summary: dto.summary };
|
|
}
|
|
|
|
getViewModel(): GetLeagueOwnerSummaryViewModel {
|
|
if (!this.result) throw new Error('Presenter not presented');
|
|
return this.result;
|
|
}
|
|
} |