refactor
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import type { ITeamMembershipRepository } from '../../domain/repositories/ITeamMembershipRepository';
|
||||
import type { RejectTeamJoinRequestCommandDTO } from '../dto/TeamCommandAndQueryDTO';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
|
||||
export class RejectTeamJoinRequestUseCase {
|
||||
constructor(
|
||||
private readonly membershipRepository: ITeamMembershipRepository,
|
||||
) {}
|
||||
|
||||
async execute(command: RejectTeamJoinRequestCommandDTO): Promise<void> {
|
||||
async execute(command: RejectTeamJoinRequestCommandDTO): Promise<Result<void, ApplicationErrorCode<'NO_ERROR'>>> {
|
||||
const { requestId } = command;
|
||||
await this.membershipRepository.removeJoinRequest(requestId);
|
||||
return Result.ok(undefined);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user