Skip to content

Commit

Permalink
fixed facility selection issue in UserAddEditForm
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Dec 20, 2024
1 parent 213e114 commit ac2793f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Users/UserAddEditForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ const UserAddEditForm = (props: UserProps) => {
...fieldMappings,
user_type: formData.user_type,
password: formData.password,
facilities: formData.facilities ? formData.facilities : undefined,
facilities: formData.facilities ?? undefined,
home_facility: formData.home_facility ?? undefined,
username: formData.username,
state: formData.state,
Expand Down Expand Up @@ -1265,7 +1265,9 @@ const UserAddEditForm = (props: UserProps) => {
defaults={userData ? state.form : initForm}
validate={validateForm}
onCancel={editUser ? handleCancel : () => goBack()}
onSubmit={editUser ? handleEditSubmit : handleSubmit}
onSubmit={() =>
editUser ? handleEditSubmit(state.form) : handleSubmit(state.form)
}
onDraftRestore={(newState) => {
dispatch({ type: "set_state", state: newState });
}}
Expand Down

0 comments on commit ac2793f

Please sign in to comment.