services refactor
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
import { TeamJoinRequestItemDto } from '../dtos';
|
||||
import type { TeamJoinRequestItemDto } from '../dtos';
|
||||
import { TeamJoinRequestViewModel } from '../view-models';
|
||||
|
||||
/**
|
||||
* Team Join Request Presenter
|
||||
* Transforms TeamJoinRequestItemDto to TeamJoinRequestViewModel
|
||||
*/
|
||||
export class TeamJoinRequestPresenter {
|
||||
present(dto: TeamJoinRequestItemDto, currentUserId: string, isOwner: boolean): TeamJoinRequestViewModel {
|
||||
return new TeamJoinRequestViewModel(dto, currentUserId, isOwner);
|
||||
}
|
||||
}
|
||||
|
||||
// Backward compatibility export (deprecated)
|
||||
export const presentTeamJoinRequest = (dto: TeamJoinRequestItemDto, currentUserId: string, isOwner: boolean): TeamJoinRequestViewModel => {
|
||||
return new TeamJoinRequestViewModel(dto, currentUserId, isOwner);
|
||||
const presenter = new TeamJoinRequestPresenter();
|
||||
return presenter.present(dto, currentUserId, isOwner);
|
||||
};
|
||||
Reference in New Issue
Block a user