From f467c2704cdb5c90ab57cb0575a2c316f34ce955 Mon Sep 17 00:00:00 2001 From: caadiq Date: Mon, 30 Mar 2026 00:29:00 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A4=EC=9D=B4=EC=96=BC=EB=A2=B0=EA=B7=B8?= =?UTF-8?q?=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ParcelDialog.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/ParcelDialog.jsx b/frontend/src/components/ParcelDialog.jsx index 3aa05c3..e6af16a 100644 --- a/frontend/src/components/ParcelDialog.jsx +++ b/frontend/src/components/ParcelDialog.jsx @@ -28,8 +28,18 @@ function ParcelDialog({ parcelId, onClose }) { const { data: parcel, isLoading } = useQuery({ queryKey: ["parcel", parcelId], - queryFn: () => fetchParcel(parcelId), + queryFn: async () => { + // 다이얼로그 열릴 때 자동으로 서버에서 새로고침 + try { + const refreshed = await refreshParcel(parcelId); + queryClient.invalidateQueries({ queryKey: ["parcels"] }); + return refreshed; + } catch { + return fetchParcel(parcelId); + } + }, enabled: !!parcelId, + staleTime: 0, }); const deleteMutation = useMutation({