diff --git a/src/pages/booking/selectOffice/SelectOffice.js b/src/pages/booking/selectOffice/SelectOffice.js index b350ff3..b64bb58 100644 --- a/src/pages/booking/selectOffice/SelectOffice.js +++ b/src/pages/booking/selectOffice/SelectOffice.js @@ -1,11 +1,17 @@ -import React, { useEffect } from "react"; +import React, {useEffect} from "react"; import SearchBar from "components/searchBar/SearchBar"; import OfficeInfo from "components/officeInfo/OfficeInfo"; import {RightContainer, WhiteContainer, TitleText, ResourceSearchBar} from "components/rightContainer/RightContainer"; -import { OfficesAxios } from "api/AxiosApi"; -import { useState } from "react"; -import { basicError } from 'utils/ErrorHandlerUtil'; -import { SearchDateContainer, SearchDateInput, SearchTextInput, SearchTitleContainer, SearchTitleText} from "../selectResource/SelectResource"; +import {OfficesAxios} from "api/AxiosApi"; +import {useState} from "react"; +import {basicError} from 'utils/ErrorHandlerUtil'; +import { + SearchDateContainer, + SearchDateInput, + SearchTextInput, + SearchTitleContainer, + SearchTitleText +} from "../selectResource/SelectResource"; import SearchButtonImg from "../../../assets/images/button/searchButton.png"; import ImageButton from "../../../components/button/ImageButton"; import {SelectToggle} from "../../../components/capsule/SelectToggle"; @@ -23,13 +29,17 @@ function SelectOffice(props) { const [endTime, setEndTime] = useState(""); const getOfficeList = () => { - OfficesAxios.get("?size=200", { + OfficesAxios.get("?size=200", { headers: { Authorization: getToken() } }) - .then((Response) => { setOffices(Response.data.data.content) }) - .catch((error) => {basicError(error)}) + .then((Response) => { + setOffices(Response.data.data.content) + }) + .catch((error) => { + basicError(error) + }) }; const changeFacilityName = (e) => { @@ -49,9 +59,17 @@ function SelectOffice(props) { } const searchOffice = () => { - OfficesAxios.get(`?date=${date}&startTime=${startTime}&endTime=${endTime}&facilityName=${facilityName}`) - .then((Response) => { setOffices(Response.data.data.content) }) - .catch((error) => {basicError(error)}) + OfficesAxios.get(`?date=${date}&startTime=${startTime}&endTime=${endTime}&facilityName=${facilityName}`, { + headers: { + Authorization: getToken() + } + }) + .then((Response) => { + setOffices(Response.data.data.content) + }) + .catch((error) => { + basicError(error) + }) } useEffect(() => { @@ -67,18 +85,19 @@ function SelectOffice(props) { 예약 가능 회의실 검색 - + - - ~ - + + ~ + - + - {offices.length === 0 ? 예약 가능한 회의실이 없습니다. : offices.map((office) => 예약 가능한 회의실이 없습니다. : offices.map((office) =>