diff --git a/src/Components/MyReservation/Contents.jsx b/src/Components/MyReservation/Contents.jsx
index 1e7307d..51b9271 100644
--- a/src/Components/MyReservation/Contents.jsx
+++ b/src/Components/MyReservation/Contents.jsx
@@ -65,6 +65,16 @@ const CancelBtn = styled.button`
}
`;
+const NoneDiv = styled.div`
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+ height: 70vh;
+ font-size: 1.8rem;
+ font-weight: 700;
+`;
+
const Contents = ({ remainTime, order, resName, peopleNum }) => {
const history = useNavigate();
// 줄서기 취소이벤트
@@ -74,6 +84,16 @@ const Contents = ({ remainTime, order, resName, peopleNum }) => {
history.push('/district1');
}
};
+
+ if (!resName) {
+ return (
+
+
+ 예약 정보가 없습니다.
+
+
+ );
+ }
return (
diff --git a/src/Layouts/MyReservation/MyReservation.jsx b/src/Layouts/MyReservation/MyReservation.jsx
index 4d5d4fa..02e732d 100644
--- a/src/Layouts/MyReservation/MyReservation.jsx
+++ b/src/Layouts/MyReservation/MyReservation.jsx
@@ -15,25 +15,29 @@ const MyReservation = () => {
try {
// user의 waiting pk 로 waiting 정보 조회 및 저장
const waitingInfo = (await userWaiting(user.username)).data;
- setWaitingInfo(waitingInfo);
- setWaitingNum(waitingInfo.members.length);
+ console.log(waitingInfo);
+ if (waitingInfo.data.success) {
+ setWaitingInfo(waitingInfo);
+ setWaitingNum(waitingInfo.members.length);
+ } else {
+ setWaitingInfo({});
+ }
} catch (error) {
return error;
}
};
+
useEffect(() => {
fetch();
}, []);
return (
- <>
-
- >
+
);
};