refactor
This commit is contained in:
@@ -2,19 +2,15 @@ import type { Driver } from '@core/racing/domain/entities/Driver';
|
||||
import type { GetDriverOutputDTO } from '../dtos/GetDriverOutputDTO';
|
||||
|
||||
export class DriverPresenter {
|
||||
private result: GetDriverOutputDTO | null = null;
|
||||
|
||||
reset(): void {
|
||||
this.result = null;
|
||||
}
|
||||
private responseModel: GetDriverOutputDTO | null = null;
|
||||
|
||||
present(driver: Driver | null): void {
|
||||
if (!driver) {
|
||||
this.result = null;
|
||||
this.responseModel = null;
|
||||
return;
|
||||
}
|
||||
|
||||
this.result = {
|
||||
this.responseModel = {
|
||||
id: driver.id,
|
||||
iracingId: driver.iracingId.toString(),
|
||||
name: driver.name.toString(),
|
||||
@@ -24,7 +20,7 @@ export class DriverPresenter {
|
||||
};
|
||||
}
|
||||
|
||||
get viewModel(): GetDriverOutputDTO | null {
|
||||
return this.result;
|
||||
getResponseModel(): GetDriverOutputDTO | null {
|
||||
return this.responseModel;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user