From 6699f2bdbf9fc37c2c4a5cd5a731b4b5ea4f4210 Mon Sep 17 00:00:00 2001 From: ryr0121 Date: Wed, 11 Oct 2023 17:18:41 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[PDW-14]=20fix:=20=EB=84=A4=ED=8A=B8?= =?UTF-8?q?=EC=9B=8C=ED=81=AC=20=EC=98=A4=EB=A5=98=20=EC=B2=98=EB=A6=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../booking/resourceBooking/ResourceBooking.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/pages/booking/resourceBooking/ResourceBooking.js b/src/pages/booking/resourceBooking/ResourceBooking.js index 08edbd0..f6d6515 100644 --- a/src/pages/booking/resourceBooking/ResourceBooking.js +++ b/src/pages/booking/resourceBooking/ResourceBooking.js @@ -13,6 +13,7 @@ import { BookingContentContainer, RequestButtonContainer, RequestBookingButton } import { RightContainer, WhiteContainer } from 'components/rightContainer/RightContainer'; import 'react-calendar/dist/Calendar.css'; import styles from "../resourceBooking/CustomCalendar.css"; +import { basicError } from 'utils/ErrorHandlerUtil'; var startDate = ''; var endDate = ''; @@ -92,11 +93,7 @@ function ResourceBooking(props) { const getResourceInfo = () => { ResourcesAxios.get(`/${resourceId}`) .then((Response) => { setResourceInfo(Response.data.data) }) - .catch((Error) => { - console.log(Error) - window.alert("자원 정보를 불러올 수 없습니댜.") - window.history.back() - }); + .catch((Error) => { basicError(Error) }); }; const getBookedDates = () => { @@ -107,11 +104,7 @@ function ResourceBooking(props) { Response.data.data.map(function (date) { temp.push(new Date(date)) }) setBookedDates(temp) }) - .catch((Error) => { - console.log(Error) - window.alert("예약 현황 정보를 불러올 수 없습니댜.") - window.history.back() - }); + .catch((Error) => { basicError(Error) }); } const changeDate = e => { From a2a00dd6875eb9960b571160204e456d6e170a36 Mon Sep 17 00:00:00 2001 From: ryr0121 Date: Wed, 11 Oct 2023 17:34:17 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[PDW-14]=20fix:=20=EB=84=A4=ED=8A=B8?= =?UTF-8?q?=EC=9B=8C=ED=81=AC=20=EC=98=A4=EB=A5=98=20=EC=B2=98=EB=A6=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resourceBooking/ResourceBooking.js | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/pages/booking/resourceBooking/ResourceBooking.js b/src/pages/booking/resourceBooking/ResourceBooking.js index f6d6515..4292c81 100644 --- a/src/pages/booking/resourceBooking/ResourceBooking.js +++ b/src/pages/booking/resourceBooking/ResourceBooking.js @@ -93,7 +93,12 @@ function ResourceBooking(props) { const getResourceInfo = () => { ResourcesAxios.get(`/${resourceId}`) .then((Response) => { setResourceInfo(Response.data.data) }) - .catch((Error) => { basicError(Error) }); + .catch((Error)=>{ + basicError(Error) + console.log(Error) + window.alert("자원 정보를 불러올 수 없습니댜.") + window.history.back() + }); }; const getBookedDates = () => { @@ -104,7 +109,12 @@ function ResourceBooking(props) { Response.data.data.map(function (date) { temp.push(new Date(date)) }) setBookedDates(temp) }) - .catch((Error) => { basicError(Error) }); + .catch((Error)=>{ + basicError(Error) + console.log(Error) + window.alert("예약 정보를 불러올 수 없습니댜.") + window.history.back() + }); } const changeDate = e => { @@ -222,11 +232,12 @@ function requestBookingOffice() { else { alert(response.data.message); } window.location.reload() }) - .catch(function (error) { - console.log(error) - window.alert("자원 예약에 실패하였습니다. \n", error.response.data.message) + .catch((Error)=>{ + basicError(Error) + console.log(Error) + window.alert("자원 예약에 실패하였습니다.") window.history.back() - }); + }); console.log('start date : ', startDate) console.log('end date : ', endDate)