Skip to content

Commit

Permalink
Fixes discharge form resetting
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Jul 12, 2024
1 parent 6739c26 commit 1aba78e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Components/Facility/DischargeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,15 @@ const DischargeModal = ({
useEffect(() => {
setPreDischargeForm((prev) => ({
...prev,
new_discharge_reason,
discharge_notes: referred_to
? "Patient Shifted to another facility."
: "",
discharge_date,
death_datetime,
referred_to_external: !referred_to?.id ? referred_to?.name : null,
referred_to: referred_to?.id ? referred_to.id : null,
}));

setFacility(referred_to);
}, [referred_to, new_discharge_reason, discharge_date, death_datetime]);
}, [referred_to]);

const discharge_reason =
new_discharge_reason ?? preDischargeForm.new_discharge_reason;
Expand Down

0 comments on commit 1aba78e

Please sign in to comment.