daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.             });
RAW Paste Data
Pastebin PRO CHRISTMAS Special!
Get 60% OFF Pastebin PRO accounts!
Top