Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

팀 유저의 역할을 제대로 비교하지 못하던 문제 해결 #125

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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