Client: refactor

This commit is contained in:
Sam
2018-05-10 20:17:03 +02:00
parent f370de62a6
commit d82a730029
9 changed files with 21 additions and 37 deletions

View File

@ -1,6 +1,7 @@
import mpwoApiUser from '../mwpoApi/user'
import { history } from '../index'
import { generateIds } from '../utils'
import { getData } from './index'
const AuthError = message => ({ type: 'AUTH_ERROR', message })
@ -39,6 +40,7 @@ export const getProfile = () => dispatch => mpwoApiUser
.getProfile()
.then(ret => {
if (ret.status === 'success') {
dispatch(getData('sports'))
return dispatch(ProfileSuccess(ret))
}
return dispatch(ProfileError(ret.message))