From 715bd4ad870f6358c515772fbd9f69e99f97c06c Mon Sep 17 00:00:00 2001 From: Shivank Kacker Date: Wed, 19 Jun 2024 19:48:40 +0530 Subject: [PATCH] Show notifications on prescription edit / failure (#8049) --- src/Components/Form/Form.tsx | 1 - src/Components/Medicine/EditPrescriptionForm.tsx | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Components/Form/Form.tsx b/src/Components/Form/Form.tsx index 6d6a4cbed0e..fccc579286c 100644 --- a/src/Components/Form/Form.tsx +++ b/src/Components/Form/Form.tsx @@ -49,7 +49,6 @@ const Form = ({ if (validate) { const errors = omitBy(validate(state.form), isEmpty) as FormErrors; - if (Object.keys(errors).length) { dispatch({ type: "set_errors", errors }); diff --git a/src/Components/Medicine/EditPrescriptionForm.tsx b/src/Components/Medicine/EditPrescriptionForm.tsx index 1af7a1a0356..78af7f38526 100644 --- a/src/Components/Medicine/EditPrescriptionForm.tsx +++ b/src/Components/Medicine/EditPrescriptionForm.tsx @@ -77,6 +77,9 @@ export default function EditPrescriptionForm(props: Props) { if (success) { props.onDone(true); + Notification.Success({ msg: "Prescription edited successfully" }); + } else { + Notification.Error({ msg: "Failed to edit prescription" }); } }} noPadding