Skip to content

Commit

Permalink
Show notifications on prescription edit / failure (#8049)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker authored Jun 19, 2024
1 parent f2a192b commit 715bd4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Components/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const Form = <T extends FormDetails>({

if (validate) {
const errors = omitBy(validate(state.form), isEmpty) as FormErrors<T>;

if (Object.keys(errors).length) {
dispatch({ type: "set_errors", errors });

Expand Down
3 changes: 3 additions & 0 deletions src/Components/Medicine/EditPrescriptionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 715bd4a

Please sign in to comment.