Skip to content

Commit

Permalink
Merge pull request #142 from Modagbul/feat/alarm_minsu
Browse files Browse the repository at this point in the history
fix: 마이페이지에서 수정할 때 닉네임 중복검사
  • Loading branch information
minsu20 authored Dec 13, 2023
2 parents c7ffca4 + fc57b2a commit 87dc516
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ public GetProfileResponse getProfile(String socialId){
public void updateProfile(String socialId, UpdateProfileRequest updateProfileRequest) {
Member member = memberGetService.getMemberBySocialId(socialId);
String oldProfileImageUrl = member.getProfileImage();
if(updateProfileRequest.getNickName()!=null){
if(memberCheckService.checkNickname(updateProfileRequest.getNickName())) throw new NicknameDuplicationException(); //닉네임 중복검사 (이중체크)
}

member.updateProfile(
UpdateUtils.getUpdatedValue(updateProfileRequest.getProfileImage(), member.getProfileImage()),
UpdateUtils.getUpdatedValue(updateProfileRequest.getNickName(), member.getNickName()),
UpdateUtils.getUpdatedValue(updateProfileRequest.getIntroduction(), member.getIntroduction())
);

if(updateProfileRequest.getNickName()!=null){
if(memberCheckService.checkNickname(updateProfileRequest.getNickName())) throw new NicknameDuplicationException(); //닉네임 중복검사 (이중체크)
}

updateUtils.deleteOldImgUrl(updateProfileRequest.getProfileImage(), oldProfileImageUrl);
}

Expand Down

0 comments on commit 87dc516

Please sign in to comment.