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

#40 [FIX] 닉네임 중복 불가 추가 #41

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
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 @@ -19,4 +19,6 @@ public interface UserProjectRepository extends JpaRepository<UserProject, Long>
List<UserProject> findAllByProjectIdOrderByReviewCountDesc(Long projectId);

Boolean existsByMemberIdAndProjectId(Long memberId, Long projectId);

boolean existsByProjectIdAndNickname(Long projectId, String memberProjectNickname);
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ public ProjectJoinResponseDto joinProject(Long memberId, ProjectJoinRequestDto p
if (userProjectRepository.existsByMemberIdAndProjectId(memberId, projectJoinRequestDto.getProjectId())){
throw new BadRequestException(("이미 프로젝트에 참여한 팀원입니다."));
}
if (userProjectRepository.existsByProjectIdAndNickname(projectJoinRequestDto.getProjectId(),projectJoinRequestDto.getMemberProjectNickname())){
throw new BadRequestException(("이미 프로젝트에 있는 닉네임입니다."));
}
Member member = findMemberById(memberId);
Project project = findProjectById(projectJoinRequestDto.getProjectId());

Expand Down
Loading