From 11d54c175fa83866f696777c4b0facf80ae42a50 Mon Sep 17 00:00:00 2001 From: psyeon1120 Date: Wed, 1 Nov 2023 17:23:06 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[PDW-66]=20feat:=20=ED=9A=8C=EC=9D=98?= =?UTF-8?q?=EC=8B=A4=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20API=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/manager/officeManage/OfficeManage.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pages/manager/officeManage/OfficeManage.js b/src/pages/manager/officeManage/OfficeManage.js index 44b0464..edec301 100644 --- a/src/pages/manager/officeManage/OfficeManage.js +++ b/src/pages/manager/officeManage/OfficeManage.js @@ -1,12 +1,11 @@ -import React from "react"; -import { useState, useEffect } from "react"; -import { RightContainer, TitleText, WhiteContainer } from "components/rightContainer/RightContainer"; +import React, {useEffect, useState} from "react"; +import {RightContainer, TitleText, WhiteContainer} from "components/rightContainer/RightContainer"; import {Bar, BookedTable, BookedThead, NoLineTr, TableContainer} from "../../booking/bookedList/BookedList"; import OfficeManageTableCell from "./OfficeManageTableCell"; import ManageSearchBar from "components/searchBar/ManageSearchBar"; -import { getToken } from "utils/IsLoginUtil"; -import { basicError } from "utils/ErrorHandlerUtil"; -import { OfficesAxios } from "api/AxiosApi"; +import {getToken} from "utils/IsLoginUtil"; +import {basicError} from "utils/ErrorHandlerUtil"; +import {AdminBookingOfficeAxios} from "api/AxiosApi"; function OfficeManage(props) { @@ -14,7 +13,7 @@ function OfficeManage(props) { const getOffices = (name) => { const max = Int32Array.max; - OfficesAxios.get(`?keyword=${name}&size=200`,{ + AdminBookingOfficeAxios.get(`?facilityName=${name}&size=200`,{ headers: { Authorization: getToken() } @@ -28,7 +27,7 @@ function OfficeManage(props) { }; useEffect(() => { - getOffices(); + getOffices(""); }, []) const moveToAdd = () => { From bcd6a2b6f5c982d7289b574cd90d6c0b1074a36b Mon Sep 17 00:00:00 2001 From: psyeon1120 Date: Wed, 1 Nov 2023 17:29:31 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[PDW-66]=20fix:=20=ED=9A=8C=EC=9D=98?= =?UTF-8?q?=EC=8B=A4=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20=ED=86=A0?= =?UTF-8?q?=ED=81=B0=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) =>