Skip to content

Commit

Permalink
Merge pull request #125 from Kusitms-28th-Meetup-D/feature/124-team
Browse files Browse the repository at this point in the history
팀 유저의 역할을 제대로 비교하지 못하던 문제 해결
  • Loading branch information
OJOJIN committed Nov 22, 2023
2 parents cf81b8a + 9223967 commit 0eaf10a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public void changeRole(Long userId, RequestChangeRoleDto requestChangeRoleDto) t
public void deleteTeam(Long userId, Long teamId) {
TeamUser teamUser = findTeamUserByUserIdAndTeamId(userId, teamId)
.orElseThrow(() -> new EntityNotFoundException(TEAM_USER_NOT_FOUND));
if (!teamUser.equals(TEAM_LEADER.getCode())) {
if (!teamUser.getRole().equals(TEAM_LEADER.getCode())) {
throw new ForbiddenException(USER_NOT_TEAMLEADER);
}
Team team = findTeamById(teamId);
Expand All @@ -242,7 +242,7 @@ public void deleteTeam(Long userId, Long teamId) {
public void updateTeamProgressRecruitment(Long userId, Long teamId) {
TeamUser teamUser = findTeamUserByUserIdAndTeamId(userId, teamId)
.orElseThrow(() -> new EntityNotFoundException(TEAM_USER_NOT_FOUND));
if (!teamUser.equals(TEAM_LEADER.getCode())) {
if (!teamUser.getRole().equals(TEAM_LEADER.getCode())) {
throw new ForbiddenException(USER_NOT_TEAMLEADER);
}
Team team = findTeamById(teamId);
Expand All @@ -254,7 +254,7 @@ public void updateTeamProgressRecruitment(Long userId, Long teamId) {
public void cancelApplyTeam(Long userId, Long teamId) {
TeamUser teamUser = findTeamUserByUserIdAndTeamId(userId, teamId)
.orElseThrow(() -> new EntityNotFoundException(TEAM_USER_NOT_FOUND));
if (!teamUser.equals(VOLUNTEER.getCode())) {
if (!teamUser.getRole().equals(VOLUNTEER.getCode())) {
throw new ForbiddenException(USER_NOT_APPLY_STATUS);
}
teamUserRepository.delete(teamUser);
Expand Down

0 comments on commit 0eaf10a

Please sign in to comment.