refactor use cases
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import type { UseCaseOutputPort } from '@core/shared/application';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import type { ILeagueMembershipRepository } from '../../domain/repositories/ILeagueMembershipRepository';
|
||||
import { LeagueMembership } from '../../domain/entities/LeagueMembership';
|
||||
@@ -22,10 +21,7 @@ export type UpdateLeagueMemberRoleErrorCode =
|
||||
| 'REPOSITORY_ERROR';
|
||||
|
||||
export class UpdateLeagueMemberRoleUseCase {
|
||||
constructor(
|
||||
private readonly leagueMembershipRepository: ILeagueMembershipRepository,
|
||||
private readonly output: UseCaseOutputPort<UpdateLeagueMemberRoleResult>,
|
||||
) {}
|
||||
constructor(private readonly leagueMembershipRepository: ILeagueMembershipRepository) {}
|
||||
|
||||
async execute(
|
||||
input: UpdateLeagueMemberRoleInput,
|
||||
@@ -74,8 +70,6 @@ export class UpdateLeagueMemberRoleUseCase {
|
||||
|
||||
await this.leagueMembershipRepository.saveMembership(updatedMembership);
|
||||
|
||||
this.output.present({ membership: updatedMembership });
|
||||
|
||||
return Result.ok(undefined);
|
||||
} catch (error: unknown) {
|
||||
const message =
|
||||
|
||||
Reference in New Issue
Block a user