-
Notifications
You must be signed in to change notification settings - Fork 8
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
[FE] 서버에서 보내주는 에러메시지 활용하도록 수정(#544) #546
Conversation
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.
기존 클라이언트에 정의된 에러 메시지도 활용할 수 있도록 했네요 👍
@@ -36,7 +36,7 @@ const useMutateAuth = () => { | |||
queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.OPENED_ROOM_LIST] }); | |||
queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.CLOSED_ROOM_LIST] }); | |||
localStorage.clear(); | |||
navigate("/"); | |||
window.location.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.
요거는 왜 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.
메인 페이지에서 로그아웃 했을 때 navigate("/") 로 하니까 참여중 탭이 그대로 보였습니다. 네이버의 로그아웃 레퍼런스를 참고하여 우리 서비스도 로그아웃 시에 강제로 "/" 페이지로 새로고침 되게 하였습니다.
이러한 이유 땜에 강제 새로고침을 하는 것으로 바꿨습니다. 다른 의견 있으시면 바로 말씀해주세요!!😊
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.
꼼꼼하게 봐주셨네요! 감사합니다~ 👍
p.s. 오늘 생일 축하해용 🎂 🎁
endpoint: API_ENDPOINTS.REVIEW_COMPLETE, | ||
body: { | ||
roomId, | ||
revieweeId, | ||
}, | ||
errorMessage: MESSAGES.ERROR.POST_PARTICIPATE_IN, | ||
errorMessage: MESSAGES.ERROR.POST_REVIEW_COMPLETE, |
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.
ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ코드 리뷰에서도 놓쳤던....
📓 스토리북 링크
바로가기
📌 관련 이슈
✨ PR 세부 내용
코드리뷰완료 요청 실패했을 때 상수화한 에러메세지가 없어서 추가했습니다.
메인 페이지에서 로그아웃 했을 때
navigate("/")
로 하니까 참여중 탭이 그대로 보였습니다. 네이버의 로그아웃 레퍼런스를 참고하여 우리 서비스도 로그아웃 시에 강제로 "/" 페이지로 새로고침 되게 하였습니다.errorMessage를 인자로 그대로 받지만
(data.message || errorMessage)
로직을 추가하여 배겐드가 넘겨준 에러메세지가 우선적으로 보여지게 하였습니다. 오류가 떴지만 배겐드가 넘겨준 메세지가 null 값이거나 undefined 이면 프론트가 상수화한 에러메세지가 출력됩니다.