refactor league module (wip)
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
import type { JoinLeagueOutputPort } from '@core/racing/application/ports/output/JoinLeagueOutputPort';
|
||||
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
|
||||
import type { JoinLeagueResult } from '@core/racing/application/use-cases/JoinLeagueUseCase';
|
||||
import type { JoinLeagueOutputDTO } from '../dtos/JoinLeagueOutputDTO';
|
||||
|
||||
export class JoinLeaguePresenter {
|
||||
export class JoinLeaguePresenter implements UseCaseOutputPort<JoinLeagueResult> {
|
||||
private result: JoinLeagueOutputDTO | null = null;
|
||||
|
||||
reset() {
|
||||
this.result = null;
|
||||
}
|
||||
|
||||
present(output: JoinLeagueOutputPort) {
|
||||
present(result: JoinLeagueResult): void {
|
||||
this.result = {
|
||||
success: true,
|
||||
membershipId: output.membershipId,
|
||||
membershipId: result.membership.id.toString(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user