presenter refactoring
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
import type { RejectLeagueJoinRequestOutputPort } from '@core/racing/application/ports/output/RejectLeagueJoinRequestOutputPort';
|
||||
import type { RejectJoinRequestOutputDTO } from '../dtos/RejectJoinRequestOutputDTO';
|
||||
|
||||
export function mapRejectLeagueJoinRequestOutputPortToDTO(port: RejectLeagueJoinRequestOutputPort): RejectJoinRequestOutputDTO {
|
||||
return {
|
||||
success: port.success,
|
||||
message: port.message,
|
||||
};
|
||||
export class RejectLeagueJoinRequestPresenter {
|
||||
private result: RejectJoinRequestOutputDTO | null = null;
|
||||
|
||||
reset() {
|
||||
this.result = null;
|
||||
}
|
||||
|
||||
present(output: RejectLeagueJoinRequestOutputPort) {
|
||||
this.result = {
|
||||
success: output.success,
|
||||
message: output.message,
|
||||
};
|
||||
}
|
||||
|
||||
getViewModel(): RejectJoinRequestOutputDTO | null {
|
||||
return this.result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user