Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 맵 상세 페이지를 새로운 API 명세에 맞게 마이그레이션 #980

Merged
merged 6 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frontend/src/hooks/query-v2/useManagerMapV2.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -13,6 +14,6 @@ const useManagerMapV2 = <TData = AxiosResponse<QueryManagerMapSuccessV2>>(
[QueryKey, QueryManagerMapParamsV2]
>
): UseQueryResult<TData, AxiosError<ErrorResponse>> =>
useQuery(['getManagerMapV2', { mapId }], queryManagerMapV2, { ...options });
useQuery(['getManagerMapV2', { mapId }], queryManagerMapV2, options);

export default useManagerMapV2;
9 changes: 2 additions & 7 deletions frontend/src/pages/ManagerMapDetail/ManagerMapDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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),
Expand Down Expand Up @@ -158,7 +156,6 @@ const ManagerMapDetail = (): JSX.Element => {
rightButtons={
getMap.data?.data != null && (
<>
<MapNoticeButton text="공지사항" size="small" map={getMap.data.data} />
<SlackNotiButton text="알림 설정" size="small" map={getMap.data.data} />
<Styled.VerticalBar />
<IconButton text="맵 편집" size="small" onClick={handleClickMapEditorIcon}>
Expand All @@ -167,8 +164,6 @@ const ManagerMapDetail = (): JSX.Element => {
<IconButton text="공간 편집" size="small" onClick={handleClickSpaceEditorIcon}>
<SpaceEditorIcon width="100%" height="100%" />
</IconButton>
<Styled.VerticalBar />
<ShareLinkButton text="공유 링크" size="small" map={getMap.data.data} />
</>
)
}
Expand Down
Loading