From 547d4936b5aa4229b5c055d7585f65d3515d0e31 Mon Sep 17 00:00:00 2001 From: LSJ Date: Tue, 24 Sep 2024 15:26:25 +0900 Subject: [PATCH] . --- modals/pop-up/LocationRegisterPopUp.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modals/pop-up/LocationRegisterPopUp.tsx b/modals/pop-up/LocationRegisterPopUp.tsx index df0bbca4c..803ede583 100644 --- a/modals/pop-up/LocationRegisterPopUp.tsx +++ b/modals/pop-up/LocationRegisterPopUp.tsx @@ -1,7 +1,9 @@ import { Box } from "@chakra-ui/react"; import { useState } from "react"; +import { useQueryClient } from "react-query"; import SearchLocation from "../../components/organisms/SearchLocation"; +import { USER_INFO } from "../../constants/keys/queryKeys"; import { useToast } from "../../hooks/custom/CustomToast"; import { useUserInfoFieldMutation } from "../../hooks/user/mutations"; import { ModalSubtitle } from "../../styles/layout/modal"; @@ -18,9 +20,11 @@ function LocationRegisterPopUp({ setIsModal }: LocationRegisterPopUp) { road_address_name: "", }); + const queryClient = useQueryClient(); const { mutate } = useUserInfoFieldMutation("locationDetail", { onSuccess() { toast("success", "등록되었습니다. 이후 연락을 기다려주세요!"); + queryClient.invalidateQueries([USER_INFO]); setIsModal(false); }, onError() {