From bcd6a2b6f5c982d7289b574cd90d6c0b1074a36b Mon Sep 17 00:00:00 2001 From: psyeon1120 Date: Wed, 1 Nov 2023 17:29:31 +0900 Subject: [PATCH] =?UTF-8?q?[PDW-66]=20fix:=20=ED=9A=8C=EC=9D=98=EC=8B=A4?= =?UTF-8?q?=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20=ED=86=A0=ED=81=B0?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../booking/selectOffice/SelectOffice.js | 53 +++++++++++++------ 1 file changed, 36 insertions(+), 17 deletions(-) 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) =>