Skip to content

Commit

Permalink
Fix: Reflect Updated Service Notes Immediately in Asset Details witho…
Browse files Browse the repository at this point in the history
…ut page reload (#9226)
  • Loading branch information
Rishith25 authored Dec 1, 2024
1 parent 8118ccf commit f76c625
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
11 changes: 9 additions & 2 deletions src/components/Assets/AssetManage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ const AssetManage = (props: AssetManageProps) => {
>();
const [transactionFilter, setTransactionFilter] = useState<any>({});

const { data: asset, loading } = useQuery(routes.getAsset, {
const {
data: asset,
loading,
refetch,
} = useQuery(routes.getAsset, {
pathParams: {
external_id: assetId,
},
Expand Down Expand Up @@ -594,7 +598,10 @@ const AssetManage = (props: AssetManageProps) => {
handleClose={() =>
setServiceEditData({ ...serviceEditData, open: false })
}
handleUpdate={() => serviceRefetch()}
handleUpdate={() => {
serviceRefetch();
refetch();
}}
show={serviceEditData.open}
viewOnly={serviceEditData.viewOnly}
/>
Expand Down
13 changes: 10 additions & 3 deletions src/components/Shifting/ShiftDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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")}
</ButtonV2>

<ButtonV2 className="w-full sm:w-auto" onClick={() => setIsPrintMode(true)}>
<ButtonV2
className="w-full sm:w-auto"
onClick={() => setIsPrintMode(true)}
>
<CareIcon icon="l-file-alt" className="mr-2 text-base" />{" "}
{t("referral_letter")}
</ButtonV2>
Expand Down

0 comments on commit f76c625

Please sign in to comment.