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

Fix #119 프로필 수정 시 닉네임 중복 체크 추가 #119

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

hyxklee
Copy link
Member

@hyxklee hyxklee commented Feb 6, 2025

📌 관련 이슈

관련 이슈 번호 #118
Close #118

🚀 작업 내용

  • 프로필에서 닉네임 수정 시 중복되는 닉네임을 체크해서 예외를 던지도록 수정했습니다.
  • 중복 검사시 만약 내 현재 닉네임을 그대로 한 상태로 변경을 눌렀을 때는 예외를 터트리지 않게 구현했습니다.
  • 지금 내 닉네임인데 저장이 안되면 플로우가 이상할 거라 판단했습니다

📸 스크린샷

image

📢 리뷰 요구사항

  • 현재 내 닉네임을 요청했을 경우 중복을 보여줄지 그대로 통과시킬지 의견을 말해주시면 좋을 것 같습니당

@hyxklee hyxklee added the 💻 Fix 코드 수정 label Feb 6, 2025
@hyxklee hyxklee self-assigned this Feb 6, 2025
@@ -38,6 +38,8 @@ public MemberResponseDto getMember(Long currentId){
@Transactional
public MemberResponseDto updateMemberInfo(Long currentId, MemberInfoRequestDto dto){
Members member = findById(currentId);
checkDuplicatedNickName(dto.nickName(), member);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

PR에 적어주신 내용 관련해서 제 생각은, 똑같은 닉네임이라면 별도의 예외를 발생시키지 않는 것이 더 자연스러운 흐름이 아닐까라는 생각이 있고 똑같은 닉네임 입력 시 프론트에서 "현재 닉네임과 동일합니다" 와 비슷한 메세지를 주는 건 유저 입장에서 좋아보입니다 !

예외 처리는 보통 비정상적인 상황을 방지하기 위한 목적으로 사용된다고 이해하고 있어서,
닉네임 수정의 경우에도 기존 닉네임과 동일하게 입력했을 때 예외를 발생시키기보다는, 단순히 변경이 이루어지지 않도록 처리해주는 지금 방식이 적절한거 같습니다 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 Fix 코드 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fix]: #118 프로필 수정시 닉네임 중복 체크 추가
2 participants