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

[FE] 서버에서 보내주는 에러메시지 활용하도록 수정(#544) #546

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 10, 2024

📓 스토리북 링크

바로가기

📌 관련 이슈

✨ PR 세부 내용

  • 코드리뷰완료 요청 실패했을 때 상수화한 에러메세지가 없어서 추가했습니다.

  • 메인 페이지에서 로그아웃 했을 때 navigate("/") 로 하니까 참여중 탭이 그대로 보였습니다. 네이버의 로그아웃 레퍼런스를 참고하여 우리 서비스도 로그아웃 시에 강제로 "/" 페이지로 새로고침 되게 하였습니다.

  • errorMessage를 인자로 그대로 받지만 (data.message || errorMessage) 로직을 추가하여 배겐드가 넘겨준 에러메세지가 우선적으로 보여지게 하였습니다. 오류가 떴지만 배겐드가 넘겨준 메세지가 null 값이거나 undefined 이면 프론트가 상수화한 에러메세지가 출력됩니다.

image

@github-actions github-actions bot added FE 프론트 개발 관련 작업 리팩터링 리팩터링 작업 기능 기능 구현 작업 labels Oct 10, 2024
@chlwlstlf chlwlstlf self-assigned this Oct 10, 2024
Copy link
Contributor

@pp449 pp449 left a 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("/");
Copy link
Contributor

Choose a reason for hiding this comment

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

요거는 왜 replace 로 바꿨나요?

Copy link
Contributor

Choose a reason for hiding this comment

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

메인 페이지에서 로그아웃 했을 때 navigate("/") 로 하니까 참여중 탭이 그대로 보였습니다. 네이버의 로그아웃 레퍼런스를 참고하여 우리 서비스도 로그아웃 시에 강제로 "/" 페이지로 새로고침 되게 하였습니다.

이러한 이유 땜에 강제 새로고침을 하는 것으로 바꿨습니다. 다른 의견 있으시면 바로 말씀해주세요!!😊

Copy link
Member

@00kang 00kang left a 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,
Copy link
Member

Choose a reason for hiding this comment

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

오 이부분은 왜 놓쳤었지,,ㅎ

Copy link
Contributor

Choose a reason for hiding this comment

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

ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ코드 리뷰에서도 놓쳤던....

@00kang 00kang merged commit 5966096 into develop Oct 10, 2024
7 checks passed
@00kang 00kang deleted the refactor/#544 branch October 10, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FE 프론트 개발 관련 작업 기능 기능 구현 작업 리팩터링 리팩터링 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FE] 서버에서 보내주는 에러메시지 활용하도록 수정
3 participants