refactor
This commit is contained in:
@@ -96,11 +96,14 @@ export class RaceService {
|
||||
async getAllRaces(): Promise<GetAllRacesPresenter> {
|
||||
this.logger.debug('[RaceService] Fetching all races.');
|
||||
|
||||
const presenter = new GetAllRacesPresenter();
|
||||
this.getAllRacesUseCase.setOutput(presenter);
|
||||
|
||||
const result = await this.getAllRacesUseCase.execute({});
|
||||
|
||||
const presenter = new GetAllRacesPresenter();
|
||||
presenter.reset();
|
||||
presenter.present(result);
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
return presenter;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user