Skip to content

Commit

Permalink
Merge pull request #67 from PLADI-ALM/feat/PDW-14-booking-resource
Browse files Browse the repository at this point in the history
[PDW-14] fix: 네트워크 오류 처리 수정
  • Loading branch information
ryr0121 authored Oct 11, 2023
2 parents 8b582d6 + a2a00dd commit fea70ac
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/pages/booking/resourceBooking/ResourceBooking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down Expand Up @@ -92,11 +93,12 @@ function ResourceBooking(props) {
const getResourceInfo = () => {
ResourcesAxios.get(`/${resourceId}`)
.then((Response) => { setResourceInfo(Response.data.data) })
.catch((Error) => {
.catch((Error)=>{
basicError(Error)
console.log(Error)
window.alert("자원 정보를 불러올 수 없습니댜.")
window.alert("자원 정보를 불러올 수 없습니댜.")
window.history.back()
});
});
};

const getBookedDates = () => {
Expand All @@ -107,11 +109,12 @@ function ResourceBooking(props) {
Response.data.data.map(function (date) { temp.push(new Date(date)) })
setBookedDates(temp)
})
.catch((Error) => {
.catch((Error)=>{
basicError(Error)
console.log(Error)
window.alert("예약 현황 정보를 불러올 수 없습니댜.")
window.alert("예약 정보를 불러올 수 없습니댜.")
window.history.back()
});
});
}

const changeDate = e => {
Expand Down Expand Up @@ -229,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)
Expand Down

0 comments on commit fea70ac

Please sign in to comment.