Skip to content

Commit

Permalink
Edit RE form validation
Browse files Browse the repository at this point in the history
  • Loading branch information
SemaiCZE committed Dec 1, 2017
1 parent b16ec8d commit 671ed62
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,21 @@ EditEnvironmentSimpleForm.propTypes = {
runtimeEnvironments: PropTypes.array
};

const validate = () => {
const validate = formData => {
const errors = {};

if (
Object.values(formData).filter(value => value === true || value === 'true')
.length === 0
) {
errors['_error'] = (
<FormattedMessage
id="app.editEnvironmentSimpleForm.validation.environments"
defaultMessage="Please add at least one runtime environment."
/>
);
}

return errors;
};

Expand Down

0 comments on commit 671ed62

Please sign in to comment.