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

feat: 로그인한 상태에서 예약을 추가/수정하는 기능 구현 #885

Merged
merged 6 commits into from
Jan 27, 2023

Conversation

Puterism
Copy link
Collaborator

구현 기능

  • 로그인한 상태에서 예약을 추가/수정하는 기능 구현

스크린샷 2023-01-26 오후 8 46 40

- 로그인한 상태에서 예약을 삭제하는 기능 구현

Close #868

@Puterism Puterism added 🌟 feature New feature or request 📚 frontend labels Jan 26, 2023
@Puterism Puterism self-assigned this Jan 26, 2023
@Puterism Puterism changed the title Feat/868 member guest reservation feat: 로그인한 상태에서 예약을 추가/수정하는 기능 구현 Jan 26, 2023
@@ -43,8 +43,6 @@ api.interceptors.response.use(
(error: AxiosError<ErrorResponse>) => {
if (error?.response?.status === 401) {
removeLocalStorageItem({ key: LOCAL_STORAGE_KEY.ACCESS_TOKEN });

history.push(PATH.LOGIN);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

해당 코드로 인해 비회원 예약할 때 내 정보를 불러오는 로직에서 401로 응답이 와서 비회원 예약 페이지 접근 시 로그인 페이지로 리다이렉트되는 문제가 있습니다.

우선 삭제해두었는데, 해당 라인으로 인해 다른 곳에 문제가 발생할 수 있다면 추가로 논의가 필요할 것 같습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

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

비회원에서 내 정보를 불러오지 않도록 처리해야하지 않을까요?

Copy link
Collaborator

Choose a reason for hiding this comment

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

저도 선영님 의견에 동의합니다용

내 정보를 불러오는 로직에 enabled 옵션을 통해서 로그인 됐을 때만 query를 실행하도록 하면 좋으럭 같아용

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

유조의 조언대로 useMember 에 enabled 옵션을 추가해서 처리 완료했습니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

f73b33b 에서 처리했습니다

@@ -49,6 +65,9 @@ const GuestReservation = (): JSX.Element => {

const isEditMode = !!reservation;

const member = useMember();
const userName = member.data?.data.userName;

const getReservations = useGuestReservations(
Copy link
Collaborator

Choose a reason for hiding this comment

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

401이 나는 부분이 여기일까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

네 맞습니다

@Puterism Puterism force-pushed the feat/868-member-guest-reservation branch from bd8d3f0 to f73b33b Compare January 27, 2023 09:38
@Puterism Puterism merged commit 1fcde82 into dev Jan 27, 2023
@Puterism Puterism deleted the feat/868-member-guest-reservation branch January 27, 2023 09:40
@xrabcde xrabcde mentioned this pull request Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 feature New feature or request 📚 frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UI] 로그인 유저의 예약 화면
3 participants