fix user form non submission error

This commit is contained in:
John Mitchell 2020-02-20 14:32:03 -05:00
parent 1accb9f939
commit bc0511fe66
2 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ function UserEdit({ user, history }) {
const [formSubmitError, setFormSubmitError] = useState(null);
const handleSubmit = async values => {
setFormSubmitError(null);
try {
await UsersAPI.update(user.id, values);
history.push(`/users/${user.id}/details`);

View File

@ -40,7 +40,7 @@ function UserFormFields({ user, i18n }) {
const organizationFieldArr = useField({
name: 'organization',
validate: required(i18n._(t`Select a value for this field`), i18n),
validate: !user.id ? required(i18n._(t`Select a value for this field`), i18n) : () => undefined
});
const organizationMeta = organizationFieldArr[1];
const organizationHelpers = organizationFieldArr[2];