From a5f7d02a61a84d7b13c5ef16cd2c4d3093d766a3 Mon Sep 17 00:00:00 2001 From: Suyoung Date: Thu, 2 Nov 2023 15:07:18 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=A7=B5=20=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A5=BC=20=EC=83=88=EB=A1=9C?= =?UTF-8?q?=EC=9A=B4=20API=20=EB=AA=85=EC=84=B8=EC=97=90=20=EB=A7=9E?= =?UTF-8?q?=EA=B2=8C=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=85=98=20(#980)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: axios api v2 작성 * refactor: api request 및 query v2 작성 * refactor: useManagerMap 사용처 v2 마이그레이션 * refactor: 불필요한 Vertical Bar 제거 * refactor: MapItemResponse type에 slackUrl 프로퍼티 추가 --------- Co-authored-by: 2yunseong <56749516+2yunseong@users.noreply.github.com> --- frontend/src/hooks/query-v2/useManagerMapV2.ts | 3 ++- frontend/src/pages/ManagerMapDetail/ManagerMapDetail.tsx | 9 ++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/frontend/src/hooks/query-v2/useManagerMapV2.ts b/frontend/src/hooks/query-v2/useManagerMapV2.ts index c03cabe54..b7147cb90 100644 --- a/frontend/src/hooks/query-v2/useManagerMapV2.ts +++ b/frontend/src/hooks/query-v2/useManagerMapV2.ts @@ -1,6 +1,7 @@ import { AxiosError, AxiosResponse } from 'axios'; import { QueryKey, useQuery, UseQueryOptions, UseQueryResult } from 'react-query'; import { QueryManagerMapParamsV2, queryManagerMapV2 } from 'api-v2/managerMap'; +import { QueryManagerMapParams } from 'api/managerMap'; import { ErrorResponse } from 'types/response'; import { QueryManagerMapSuccessV2 } from 'types/response-v2'; @@ -13,6 +14,6 @@ const useManagerMapV2 = >( [QueryKey, QueryManagerMapParamsV2] > ): UseQueryResult> => - useQuery(['getManagerMapV2', { mapId }], queryManagerMapV2, { ...options }); + useQuery(['getManagerMapV2', { mapId }], queryManagerMapV2, options); export default useManagerMapV2; diff --git a/frontend/src/pages/ManagerMapDetail/ManagerMapDetail.tsx b/frontend/src/pages/ManagerMapDetail/ManagerMapDetail.tsx index e5a6622c1..11f0acbbb 100644 --- a/frontend/src/pages/ManagerMapDetail/ManagerMapDetail.tsx +++ b/frontend/src/pages/ManagerMapDetail/ManagerMapDetail.tsx @@ -11,13 +11,11 @@ import DateInput from 'components/DateInput/DateInput'; import Header from 'components/Header/Header'; import IconButton from 'components/IconButton/IconButton'; import Layout from 'components/Layout/Layout'; -import MapNoticeButton from 'components/ManagerIconButtons/MapNoticeButton'; -import ShareLinkButton from 'components/ManagerIconButtons/ShareLinkButton'; import SlackNotiButton from 'components/ManagerIconButtons/SlackNotiButton'; import PageHeader from 'components/PageHeader/PageHeader'; import MESSAGE from 'constants/message'; import PATH, { HREF } from 'constants/path'; -import useManagerMap from 'hooks/query/useManagerMap'; +import useManagerMapV2 from 'hooks/query-v2/useManagerMapV2'; import useManagerMapReservations from 'hooks/query/useManagerMapReservations'; import useManagerSpaces from 'hooks/query/useManagerSpaces'; import { Reservation } from 'types/common'; @@ -41,7 +39,7 @@ const ManagerMapDetail = (): JSX.Element => { const [date, setDate] = useState(targetDate ?? dayjs().tz()); - const getMap = useManagerMap( + const getMap = useManagerMapV2( { mapId: mapId }, { enabled: !isNullish(mapId), @@ -158,7 +156,6 @@ const ManagerMapDetail = (): JSX.Element => { rightButtons={ getMap.data?.data != null && ( <> - @@ -167,8 +164,6 @@ const ManagerMapDetail = (): JSX.Element => { - - ) }