From 7345e5513c5065890177e8af0e2958047c20bc2a Mon Sep 17 00:00:00 2001 From: Ginieee Date: Mon, 19 Aug 2024 11:30:08 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=9B=8C=EC=BC=80=EC=9D=B4=EC=85=98=20?= =?UTF-8?q?=EC=9E=A5=EC=86=8C=20=EC=88=98=EC=A0=95=EC=97=90=20=EC=A7=80?= =?UTF-8?q?=EB=8F=84=20=EB=93=B1=EB=A1=9D=20=EB=B0=8F=20refetch=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workation/place/[id]/edit/page.tsx | 16 +++++++++++++++- src/app/_hooks/admin/useGetWkPlaceListQuery.ts | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/app/(route)/admin/(with-layout)/workation/place/[id]/edit/page.tsx b/src/app/(route)/admin/(with-layout)/workation/place/[id]/edit/page.tsx index c95e0953..a8ff7d8b 100644 --- a/src/app/(route)/admin/(with-layout)/workation/place/[id]/edit/page.tsx +++ b/src/app/(route)/admin/(with-layout)/workation/place/[id]/edit/page.tsx @@ -17,6 +17,7 @@ import { Address, useDaumPostcodePopup } from 'react-daum-postcode'; import { useGetKakaoAdddress } from '@/_hooks/admin/useGetKakaoAddress'; import AdminLoading from '@/_components/admin/adminLoading'; import NetworkError from '@/_components/common/networkError'; +import KakaoMapContainer from '@/_components/common/containers/KakaoMapContainer'; interface WkPlaceEditProps { params: { id: number }; @@ -97,6 +98,12 @@ const AdminWorkationPlaceEditPage = ({ params }: WkPlaceEditProps) => { })); }; + const handleAddressClick = () => { + open({ + onComplete: handleComplete, + }); + }; + const { data: kakaoAddress } = useGetKakaoAdddress({ address: originAddress, }); @@ -165,8 +172,9 @@ const AdminWorkationPlaceEditPage = ({ params }: WkPlaceEditProps) => { subtitle="주소" placeholder="주소를 입력하세요." value={values.address} - onChange={handleChange} + status="cursor" name="address" + onClick={() => handleAddressClick()} />
@@ -184,6 +192,12 @@ const AdminWorkationPlaceEditPage = ({ params }: WkPlaceEditProps) => { onChange={() => {}} />
+ {kakaoAddress && ( + + )}
{values.fileInfos.length > 0 && (
diff --git a/src/app/_hooks/admin/useGetWkPlaceListQuery.ts b/src/app/_hooks/admin/useGetWkPlaceListQuery.ts index 343426db..466fc8e8 100644 --- a/src/app/_hooks/admin/useGetWkPlaceListQuery.ts +++ b/src/app/_hooks/admin/useGetWkPlaceListQuery.ts @@ -21,5 +21,6 @@ export const useGetWkPlaceListQuery = ({ }); return workationPlaceListSchema.parse(res.data.data); }, + refetchOnMount: true, }); };