refactor core presenters
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
import { IGetTotalLeaguesPresenter, GetTotalLeaguesResultDTO, GetTotalLeaguesViewModel } from '@core/racing/application/presenters/IGetTotalLeaguesPresenter';
|
||||
import { LeagueStatsDTO } from '../dtos/LeagueStatsDTO';
|
||||
import { GetTotalLeaguesOutputPort } from '@core/racing/application/ports/output/GetTotalLeaguesOutputPort';
|
||||
import { TotalLeaguesDTO } from '../dtos/TotalLeaguesDTO';
|
||||
|
||||
export class TotalLeaguesPresenter implements IGetTotalLeaguesPresenter {
|
||||
private result: LeagueStatsDto | null = null;
|
||||
export class TotalLeaguesPresenter {
|
||||
private result: TotalLeaguesDTO | null = null;
|
||||
|
||||
reset() {
|
||||
this.result = null;
|
||||
}
|
||||
|
||||
present(dto: GetTotalLeaguesResultDTO) {
|
||||
present(output: GetTotalLeaguesOutputPort) {
|
||||
this.result = {
|
||||
totalLeagues: dto.totalLeagues,
|
||||
totalLeagues: output.totalLeagues,
|
||||
};
|
||||
}
|
||||
|
||||
getViewModel(): LeagueStatsDto | null {
|
||||
getViewModel(): TotalLeaguesDTO | null {
|
||||
return this.result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user