Skip to content

Commit

Permalink
Fix patient name in transfer success notification and redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
konavivekramakrishna committed Dec 8, 2023
1 parent 896f51b commit 0016206
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Components/Facility/TransferPatientDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,17 @@ 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`,
});
const newFacilityId =
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");
Expand Down

0 comments on commit 0016206

Please sign in to comment.