Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function validate(values) {
- const errors = {};
- if (!values.username) errors.username = 'Ingresa un nombre de usuario';
- if (!values.email) errors.email = 'Ingresa tu correo';
- if (!values.password) errors.password = 'Ingresa una contraseña';
- if (!values.repeatPassword) {
- errors.repeatPassword = 'Ingresa una contraseña';
- } else if (values.repeatPassword !== values.password) {
- errors.repeatPassword = 'Las contraseñas no coinciden';
- }
- // If errors is empty, the form is fine to submit
- // If errors has any properties, redux form assumes form is invalid
- return errors;
- }
- export default reduxForm({
- validate,
- form: 'UserSignup',
- })(SignupForm);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement