Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { connect } from 'react-redux'
- import { URL, RP, C } from '../constants'
- import { updateRegisterStatus } from '../actions'
- import { fetchApi } from '../helpers'
- import { accountCreateRequest, accountCreateSuccess } from '../actions'
- import CreateAccountComponent from '../components/CreateAccountComponent'
- const mapStateToProps = state => {
- return {
- authProcessing: state.authReducer.processing,
- registerStepperStatus: state.authReducer.registerStepperStatus,
- authError: state.authReducer.error || '',
- accessToken: state.authReducer.accessToken
- }
- }
- const mapDispatchToProps = dispatch => {
- return {
- fetchAccountCreate: (successCallback, errorCallback) => {
- dispatch(accountCreateRequest())
- fetchApi(URL.URL_ACCT_CREATE, {inclSummary: false},
- res => {
- dispatch(accountCreateSuccess())
- res.success
- ? successCallback(res.data)
- : errorCallback(res.errorCode, res.errorDescription);
- },
- err => errorCallback(err)
- )
- }
- }
- }
- const CreateAccountContainer = connect(
- mapStateToProps,
- mapDispatchToProps
- )(CreateAccountComponent)
- export default CreateAccountContainer
Add Comment
Please, Sign In to add comment