From f76c6250ec25c6d9216f58088ca4f9833e872743 Mon Sep 17 00:00:00 2001 From: Kamishetty Rishith <119791436+Rishith25@users.noreply.github.com> Date: Sun, 1 Dec 2024 12:21:46 +0530 Subject: [PATCH] =?UTF-8?q?Fix:=20Reflect=20Updated=20Service=20Notes=20Im?= =?UTF-8?q?mediately=20in=20Asset=20Details=20without=C2=A0page=C2=A0reloa?= =?UTF-8?q?d=20(#9226)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Assets/AssetManage.tsx | 11 +++++++++-- src/components/Shifting/ShiftDetails.tsx | 13 ++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/components/Assets/AssetManage.tsx b/src/components/Assets/AssetManage.tsx index c78be71d627..b4377d2e1aa 100644 --- a/src/components/Assets/AssetManage.tsx +++ b/src/components/Assets/AssetManage.tsx @@ -69,7 +69,11 @@ const AssetManage = (props: AssetManageProps) => { >(); const [transactionFilter, setTransactionFilter] = useState({}); - const { data: asset, loading } = useQuery(routes.getAsset, { + const { + data: asset, + loading, + refetch, + } = useQuery(routes.getAsset, { pathParams: { external_id: assetId, }, @@ -594,7 +598,10 @@ const AssetManage = (props: AssetManageProps) => { handleClose={() => setServiceEditData({ ...serviceEditData, open: false }) } - handleUpdate={() => serviceRefetch()} + handleUpdate={() => { + serviceRefetch(); + refetch(); + }} show={serviceEditData.open} viewOnly={serviceEditData.viewOnly} /> diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index bc97b0b0f24..cb5140d6ed0 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -492,13 +492,20 @@ export default function ShiftDetails(props: { id: string }) { : "" } tooltipClassName="tooltip-top -translate-x-28 -translate-y-1 text-xs" - disabled={data?.status === "COMPLETED" || data?.status === "CANCELLED"} - onClick={() => navigate(`/shifting/${data?.external_id}/update`)} + disabled={ + data?.status === "COMPLETED" || data?.status === "CANCELLED" + } + onClick={() => + navigate(`/shifting/${data?.external_id}/update`) + } > {t("update_status_details")} - setIsPrintMode(true)}> + setIsPrintMode(true)} + > {" "} {t("referral_letter")}