Skip to content

Commit

Permalink
fix: 비회원 예약 시, 내 정보를 불러오지 않도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Puterism committed Jan 27, 2023
1 parent 277c86f commit f73b33b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions frontend/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ api.interceptors.response.use(
(error: AxiosError<ErrorResponse>) => {
if (error?.response?.status === 401) {
removeLocalStorageItem({ key: LOCAL_STORAGE_KEY.ACCESS_TOKEN });

history.push(PATH.LOGIN);
}

return Promise.reject(error);
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/pages/GuestReservation/GuestReservation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ const GuestReservation = (): JSX.Element => {

const isEditMode = !!reservation;

const member = useMember();
const member = useMember({
enabled: !!accessToken,
});
const userName = member.data?.data.userName;

const getReservations = useGuestReservations(
Expand Down

0 comments on commit f73b33b

Please sign in to comment.