-
Notifications
You must be signed in to change notification settings - Fork 2
[Feat] 탈퇴한 사용자 '알 수 없음' 처리 #636
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
Conversation
Deploying dash-client with
|
| Latest commit: |
e7a5a99
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://12e31025.dash-client.pages.dev |
| Branch Preview URL: | https://feat-631-withdraw-unknown.dash-client.pages.dev |
|
✅ Storybook 배포 완료! 🔗 https://67e4fd1fd2c7078dceec04a4-drrldilwsm.chromatic.com/ |
Deploying dash-client-dev with
|
| Latest commit: |
e7a5a99
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://86a19eb2.dash-client-dev.pages.dev |
| Branch Preview URL: | https://feat-631-withdraw-unknown.dash-client-dev.pages.dev |
constantly-dev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다~~ 👍
| } | ||
|
|
||
| if (isError || !data) { | ||
| if (isError || !data || data.detail === '탈퇴한 회원입니다.') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 조건 문자열 비교 이외에 다른 방법은 없을까요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재 response 기준으로 탈퇴 여부를 구분할 수 있는 값이
nickname: "알 수 없음", profileImage: null, detail: "탈퇴한 회원입니다." 이렇게 세 가지가 있습니다.
이 중에서 "탈퇴한 회원입니다."가 의미상 가장 명확하게 탈퇴 여부를 표현하고 있다고 판단해서 현재는 detail 값을 기준으로 분기 처리했습니다.
다만 다른 곳에서는 nickname을 기준으로 처리를 하고 있어서 일관성을 위해 이 로직도 nickname 기준으로 통일하는 것이 더 나을지 고민이 되네요 ..
이 부분에 대해 의견 주시면 그에 맞춰 수정하겠습니다 ㅎㅎ
| if (!isValidLessonId) { | ||
| return <Navigate to={ROUTES_CONFIG.error.path} replace />; | ||
| } | ||
|
|
||
| if (isPending) return null; | ||
|
|
||
| if (isError || !data) { | ||
| return <Navigate to={ROUTES_CONFIG.error.path} replace />; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isValidLessonId와 error/data 조건 처리에 대한 return 값이 같은데 한번에 처리하는 것은 너무 가독성이 별로일까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isValidLessonId와 isError / !data는 의미상 역할이 다르다고 생각해서 분리해두는 쪽이 의도를 읽기에는 더 낫다고 판단했습니다!
isValidLessonId는 라우팅 파라미터 자체가 잘못된 경우에 대한 입력 검증 단계이고,
isError / !data는 유효한 ID로 요청했지만 서버/데이터 조회에 실패한 경우라서
현 단계에서는 의도 드러내기 측면에서 분리 유지가 더 적절하다고 생각했습니다.
다만 가드 관련 로직이 점점 필요한 부분에 추가되는 형태가 되고 있어서,
추후에 한 번 전체적으로 정리하거나 구조를 개선할 필요는 있을 것 같습니당 ..
📌 Related Issues
✅ 체크 리스트
📄 Tasks
탈퇴한 사용자
알 수 없음처리 했는데,따로 탈퇴사용자 표시가 아니라 그냥 nickname이
알 수 없음으로 오고 profileImage가null로 오고 있어서== '알 수 없음'방식으로 구분했습니다.알 수 없음이 많이 쓰이고 있어서 상수로 분리했습니다.reservation/:id에서 클래스 신청할때, 기한 지난 클래스나 신청했던 클래스들의 신청이 막혔던 것 같은데, 어제 다시 해보니 신청이 되어서 해당 부분 로직 수정도 이 브랜치에서 진행했습니다. reservationGuard 추가해주었습니다.⭐ PR Point
📷 Screenshot
🔔 ETC