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 ] 약속 리스트 페이지 에러 처리 #287

Merged
merged 10 commits into from
Oct 18, 2024

Conversation

se0jinYoon
Copy link
Collaborator

#️⃣ Related Issue

Closes #283

✅ Done Task

  • 약속 리스트 페이지 에러처리

☀️ New-insight

💎 PR Point

  • 에러처리가 한개도 안되어있어서 쿼리 함수에서 isError를 뱉을 경우 ErrorPage로 이동시켜줬습니다
  • location.state로 약속디테일페이지로 전달되는 값들이 undefined로 잡힐 경우 다시 약속 리스트로 라우팅 시켜줬습니다 (location.state의 값들이 전부 약속리스트 페이지에서부터 전달되기 때문에)
  • [선배]가 약속 수락할 때
  1. 구글밋 링크 생성 api
  2. 생성된 구글밋 링크를 포함해서 약속 수락 api
    이렇게 두 개의 api를 쏴야하는데, 구글밋 링크 생성 api가 생각보다 오래걸려서 (1~2초 정도) 사용자가 이게 요청이 간 건지 모를 것 같더라구요
    isLoading 받아와서 로딩스피너 추가해주었습니다.
  • 현재는 isError를 뱉을 경우 다 ErrorPage로 라우팅 시켜주는 방식으로 에러 처리해두었는데 (location.state 없을 경우 제외) 좀 더 세분화해서 에러처리를 해볼 예정입니다 (추후에)
  • 서버에서 받아오는 에러코드에 따라서 세분화해서 alert창을 띄워줘볼까 생각중입니다, (구글밋 입장링크가 잘못되었어요! / 해당 약속에 대한 권한이 없어요!) 등등 사용자가 좀 더 알아보기 쉽게 ? 에러처리하고싶은데 서버랑도 얘기를 해봐야할 것 같아요 !

📸 Screenshot

약속 수락 로딩스피너 추가한 부분

2024-10-14.11.44.14.mov

@se0jinYoon se0jinYoon added 🛠 Fix 기존의 버그 수정 서진 labels Oct 14, 2024
@se0jinYoon se0jinYoon self-assigned this Oct 14, 2024
Copy link
Collaborator

@ijieun ijieun left a comment

Choose a reason for hiding this comment

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

LGTM

const { prevTap } = location.state || {};

const [tap, setTap] = useState('pending');
Copy link
Collaborator

Choose a reason for hiding this comment

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

P4) 개인적인 생각으로 tap 이라는 변수명이 의도가 직관적으로 와닿지 않아서 appointmentStatus 등의 의미가 드러나는 이름을 사용하면 좋을 것 같습니다!

Copy link
Member

@j-nary j-nary left a comment

Choose a reason for hiding this comment

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

LGTM 고생하셨습니당! 코리 몇 개만 확인해주세용 🚀🚀🚀

Comment on lines 328 to 344
{viewType === 'DECLINE' ? (
<AutoCloseModal text="선약이 거절되었어요" showModal={isModalOpen} handleShowModal={handleModalOpen} path="/promiseList">
<AutoCloseModal
text="선약이 거절되었어요"
showModal={isModalOpen}
handleShowModal={handleModalOpen}
path="/promiseList">
<ModalRejectImg />
</AutoCloseModal>
) : (
<AutoCloseModal text="선약이 수락되었어요" showModal={isModalOpen} handleShowModal={handleModalOpen} path="/promiseList">
<AutoCloseModal
text="선약이 수락되었어요"
showModal={isModalOpen}
handleShowModal={handleModalOpen}
path="/promiseList">
<ModalAcceptImg />
</AutoCloseModal>
)}
Copy link
Member

@j-nary j-nary Oct 18, 2024

Choose a reason for hiding this comment

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

viewType에 따라 text랑 Img만 조건부 넣어주면 더 깔끔해질 것 같아요!

<AutoCloseModal
  text={viewType === 'DECLINE' ? "거절" : "수락"}
  ...
/>
{viewType === 'DECLINE' ? <RejectImg/> : <AcceptImg/>}

@@ -74,11 +74,11 @@ export const usePatchSeniorAccept = (onSuccessCallback?: () => void) => {
},
});

return { mutate, data };
return { mutate, data, isPending, isError };
};
Copy link
Member

Choose a reason for hiding this comment

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

hook 폴더로 빼서 파일 분리 해주면 좋을 것 같아요!

@se0jinYoon se0jinYoon merged commit 26362ed into develop Oct 18, 2024
1 check passed
@se0jinYoon se0jinYoon deleted the fix/#283/promiseListError branch October 18, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 Fix 기존의 버그 수정 size/m 서진
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[ Fix ] 약속 리스트 페이지 에러처리
3 participants