Skip to content

Commit

Permalink
Consultation Form: fix discharge notification (#5585)
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad authored Jun 2, 2023
1 parent a1fb828 commit 1162fa1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -570,12 +570,6 @@ export const ConsultationForm = (props: any) => {
}
};

const getNotificationMessage = () => {
if (state.form.suggestion !== "A") return "Patient discharged successfully";

return `Consultation ${id ? "updated" : "created"} successfully`;
};

const handleSubmit = async (
e:
| React.FormEvent<HTMLFormElement>
Expand Down Expand Up @@ -651,7 +645,9 @@ export const ConsultationForm = (props: any) => {
}

Notification.Success({
msg: getNotificationMessage(),
msg: res.data.discharge_date
? "Patient discharged successfully"
: `Consultation ${id ? "updated" : "created"} successfully`,
});

navigate(
Expand Down

0 comments on commit 1162fa1

Please sign in to comment.