Guest User

Untitled

a guest
Dec 7th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. submit = () => {
  2. const selections = { ...this.state };
  3. delete selections.errors;
  4. delete selections.passwords_match;
  5.  
  6. const validationResult = this.validate(selections, loginInfoRules);
  7.  
  8. if(validationResult === null){
  9.  
  10. this.props.setSelection({
  11. 'login-registration-step': selections
  12. });
  13. this.setBreadcrump();
  14. this.props.nextStep();
  15.  
  16. } else{
  17. this.addErrors(validationResult.details);
  18. }
  19. }
  20.  
  21. axios.post('/login', formattedData)
  22. .then(response => {
  23. registrationSuccess();
  24. // registrationError();
  25. nextStep();
  26. })
  27. .catch(err => {
  28. // registrationSuccess();
  29. registrationError();
  30. nextStep();
  31. });
Add Comment
Please, Sign In to add comment