unicorn-signup-component
Version:
Unicorn SignUp Component
18 lines (15 loc) • 502 B
JavaScript
import axios from 'axios';
const SignUpMethods = {
signUpUser( event ){
if ( event ) event.preventDefault()
//Fake API: TODO: This should be a prop of the component
axios.post( 'https://reqres.in/api/users' )
.then( response => {
this.signup_success = 'Congrats! User registered. You are now part of the matrix.'
} )
.catch( ( error ) => {
this.signup_error = 'There was an error signin up the user. Please Try again.'
} )
}
}
export default SignUpMethods