From 0016206caf72a9d5cb232eece3f1aafcedcc8d2f Mon Sep 17 00:00:00 2001 From: vivek Date: Fri, 8 Dec 2023 23:45:27 +0530 Subject: [PATCH] Fix patient name in transfer success notification and redirection --- src/Components/Facility/TransferPatientDialog.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Components/Facility/TransferPatientDialog.tsx b/src/Components/Facility/TransferPatientDialog.tsx index 632765c2492..f59e8b2e407 100644 --- a/src/Components/Facility/TransferPatientDialog.tsx +++ b/src/Components/Facility/TransferPatientDialog.tsx @@ -125,6 +125,9 @@ const TransferPatientDialog = (props: Props) => { if (res && res.data && res.status === 200) { dispatch({ type: "set_form", form: initForm }); handleOk(); + + const patientName = + patientOptions.find((p) => p.id === state.form.patient)?.text || ""; Notification.Success({ msg: `Patient ${res.data.patient} transferred successfully`, }); @@ -132,7 +135,7 @@ const TransferPatientDialog = (props: Props) => { res.data && res.data.facility_object && res.data.facility_object.id; if (newFacilityId) { navigate( - `/facility/${newFacilityId}/patient/${res.data.patient}/consultation` + `/facility/${newFacilityId}/patient/${patientName}/consultation` ); } else { navigate("/facility");