refactor core presenters
This commit is contained in:
@@ -4,7 +4,7 @@ import type { ISeasonRepository } from '../../domain/repositories/ISeasonReposit
|
||||
import type { ILeagueScoringConfigRepository } from '../../domain/repositories/ILeagueScoringConfigRepository';
|
||||
import type { IGameRepository } from '../../domain/repositories/IGameRepository';
|
||||
import type { LeagueScoringPresetProvider } from '../ports/LeagueScoringPresetProvider';
|
||||
import type { LeagueEnrichedData } from '../presenters/IAllLeaguesWithCapacityAndScoringPresenter';
|
||||
import type { LeagueEnrichedData, AllLeaguesWithCapacityAndScoringOutputPort } from '../ports/output/AllLeaguesWithCapacityAndScoringOutputPort';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
|
||||
/**
|
||||
@@ -22,7 +22,7 @@ export class GetAllLeaguesWithCapacityAndScoringUseCase
|
||||
private readonly presetProvider: LeagueScoringPresetProvider,
|
||||
) {}
|
||||
|
||||
async execute(): Promise<Result<LeagueEnrichedData[]>> {
|
||||
async execute(): Promise<Result<AllLeaguesWithCapacityAndScoringOutputPort>> {
|
||||
const leagues = await this.leagueRepository.findAll();
|
||||
|
||||
const enrichedLeagues: LeagueEnrichedData[] = [];
|
||||
@@ -72,7 +72,7 @@ export class GetAllLeaguesWithCapacityAndScoringUseCase
|
||||
...(preset ? { preset } : {}),
|
||||
});
|
||||
}
|
||||
return Result.ok(enrichedLeagues);
|
||||
return Result.ok({ leagues: enrichedLeagues });
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user