-
Notifications
You must be signed in to change notification settings - Fork 20
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
Conversation
frontend/src/api/api.ts
Outdated
@@ -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); |
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.
해당 코드로 인해 비회원 예약할 때 내 정보를 불러오는 로직에서 401로 응답이 와서 비회원 예약 페이지 접근 시 로그인 페이지로 리다이렉트되는 문제가 있습니다.
우선 삭제해두었는데, 해당 라인으로 인해 다른 곳에 문제가 발생할 수 있다면 추가로 논의가 필요할 것 같습니다.
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.
저도 선영님 의견에 동의합니다용
내 정보를 불러오는 로직에 enabled
옵션을 통해서 로그인 됐을 때만 query를 실행하도록 하면 좋으럭 같아용
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.
유조의 조언대로 useMember 에 enabled 옵션을 추가해서 처리 완료했습니다.
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.
f73b33b 에서 처리했습니다
@@ -49,6 +65,9 @@ const GuestReservation = (): JSX.Element => { | |||
|
|||
const isEditMode = !!reservation; | |||
|
|||
const member = useMember(); | |||
const userName = member.data?.data.userName; | |||
|
|||
const getReservations = useGuestReservations( |
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.
401이 나는 부분이 여기일까요?
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.
네 맞습니다
bd8d3f0
to
f73b33b
Compare
구현 기능
- 로그인한 상태에서 예약을 삭제하는 기능 구현
Close #868