Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
style(actions/auth): formatting
Browse files Browse the repository at this point in the history
style(actions/auth): formatting
  • Loading branch information
Metnew committed Aug 14, 2017
1 parent 13f5414 commit 1898860
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/common/actions/auth/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
loginAPI,
setLocalToken,
resetLocalToken,
resultOK
} from 'api'
import {loginAPI, setLocalToken, resetLocalToken, resultOK} from 'api'

export const LOGIN_AUTH_PENDING = 'LOGIN_AUTH_PENDING'
export const LOGIN_AUTH_SUCCESS = 'LOGIN_AUTH_SUCCESS'
Expand All @@ -14,7 +9,7 @@ export const LOGOUT_AUTH_SUCCESS = 'LOGOUT_AUTH_SUCCESS'
export const LOGIN_AUTH = async data => {
const result = await loginAPI(data)
if (!resultOK(result)) {
return {type: LOGIN_AUTH_FAIL, errors: result.data}
return {type: LOGIN_AUTH_FAIL, errors: result && result.data}
}
setLocalToken(result.data.token)
return {type: LOGIN_AUTH_SUCCESS, result: result.data}
Expand Down

0 comments on commit 1898860

Please sign in to comment.