@@ -126,17 +136,20 @@ const ReservationPage = ({ export default ReservationPage; export async function getServerSideProps() { - const res1 = await PoPoAxios.get('statistics/reservation/count'); + const res1 = await PoPoAxios.get('statistics/reservation/place/count'); const placeReservationCntStats = res1.data; - const { totalReservationCnt, todayReservationCnt, thisWeekReservationCnt } = - placeReservationCntStats; + const res2 = await PoPoAxios.get('statistics/reservation/equipment/count'); + const equipReservationCntStats = res2.data; return { props: { - totalReservationCnt, - todayReservationCnt, - thisWeekReservationCnt, + totalPlaceReservationCnt: placeReservationCntStats.totalReservationCnt, + todayPlaceReservationCnt: placeReservationCntStats.todayReservationCnt, + thisWeekPlaceReservationCnt: placeReservationCntStats.thisWeekReservationCnt, + totalEquipReservationCnt: equipReservationCntStats.totalReservationCnt, + todayEquipReservationCnt: equipReservationCntStats.todayReservationCnt, + thisWeekEquipReservationCnt: equipReservationCntStats.thisWeekReservationCnt, }, }; } diff --git a/pages/statistics/index.jsx b/pages/statistics/index.jsx index 8f0ca43..3a54a73 100644 --- a/pages/statistics/index.jsx +++ b/pages/statistics/index.jsx @@ -15,7 +15,7 @@ const NewPlaceReservationBar = dynamic( { ssr: false }, ); const NewEquipmentReservationBar = dynamic( - () => import('../../components/statistics/new-place-reservation.bar'), + () => import('../../components/statistics/new-equip-reservation.bar'), { ssr: false }, );