Skip to content

Commit

Permalink
handleChange function fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 committed Nov 18, 2024
1 parent c7d0e5a commit 54f6a31
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/Facility/TransferPatientDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ const TransferPatientDialog = (props: Props) => {
const handleChange = (e: FieldChangeEvent<unknown>) => {
const value = String(e.value);

if (value.length <= 4) {
if (e.name === "year_of_birth") {
if (value.length <= 4) {
dispatch({
type: "set_form",
form: { ...state.form, [e.name]: e.value },
});
}
} else {
dispatch({
type: "set_form",
form: { ...state.form, [e.name]: e.value },
Expand Down

0 comments on commit 54f6a31

Please sign in to comment.