fix issues in core
This commit is contained in:
@@ -144,7 +144,7 @@ describe('DashboardOverviewPresenter', () => {
|
||||
it('maps DashboardOverviewResult to DashboardOverviewDTO correctly', () => {
|
||||
const output = createOutput();
|
||||
|
||||
presenter.present(Result.ok(output));
|
||||
presenter.present(output);
|
||||
const dto = presenter.getResponseModel();
|
||||
|
||||
expect(dto.activeLeaguesCount).toBe(2);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
|
||||
import type {
|
||||
DashboardOverviewResult,
|
||||
} from '@core/racing/application/use-cases/DashboardOverviewUseCase';
|
||||
@@ -13,12 +13,10 @@ import {
|
||||
DashboardFriendSummaryDTO,
|
||||
} from '../dtos/DashboardOverviewDTO';
|
||||
|
||||
export class DashboardOverviewPresenter {
|
||||
export class DashboardOverviewPresenter implements UseCaseOutputPort<DashboardOverviewResult> {
|
||||
private responseModel: DashboardOverviewDTO | null = null;
|
||||
|
||||
present(result: Result<DashboardOverviewResult, unknown>): void {
|
||||
const data = result.unwrap();
|
||||
|
||||
present(data: DashboardOverviewResult): void {
|
||||
const currentDriver: DashboardDriverSummaryDTO | null = data.currentDriver
|
||||
? {
|
||||
id: data.currentDriver.driver.id,
|
||||
|
||||
Reference in New Issue
Block a user