presenter refactoring
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
import type { RemoveLeagueMemberOutputPort } from '@core/racing/application/ports/output/RemoveLeagueMemberOutputPort';
|
||||
import type { RemoveLeagueMemberOutputDTO } from '../dtos/RemoveLeagueMemberOutputDTO';
|
||||
|
||||
export function mapRemoveLeagueMemberOutputPortToDTO(port: RemoveLeagueMemberOutputPort): RemoveLeagueMemberOutputDTO {
|
||||
return {
|
||||
success: port.success,
|
||||
};
|
||||
export class RemoveLeagueMemberPresenter {
|
||||
private result: RemoveLeagueMemberOutputDTO | null = null;
|
||||
|
||||
reset() {
|
||||
this.result = null;
|
||||
}
|
||||
|
||||
present(output: RemoveLeagueMemberOutputPort) {
|
||||
this.result = {
|
||||
success: output.success,
|
||||
};
|
||||
}
|
||||
|
||||
getViewModel(): RemoveLeagueMemberOutputDTO | null {
|
||||
return this.result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user