diff options
Diffstat (limited to 'scraper/client/actions.js')
| -rw-r--r-- | scraper/client/actions.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scraper/client/actions.js b/scraper/client/actions.js index 8a1f13a6..1f7baf97 100644 --- a/scraper/client/actions.js +++ b/scraper/client/actions.js @@ -3,8 +3,9 @@ import * as types from './types' export const api = (dispatch, method, tag, url, params) => { dispatch({ type: types.api.loading, tag }) - method(url, params).then(data => { + return method(url, params).then(data => { dispatch({ type: types.api.loaded, tag, data }) + return data }).catch(err => { dispatch({ type: types.api.error, tag, err }) }) @@ -31,12 +32,13 @@ export const postAddress = data => dispatch => { api(dispatch, post, 'address', '/api/address/add', data) } -export const getVerification = sha256 => dispatch => { +export const getVerification = sha256 => dispatch => ( api(dispatch, get, 'address', '/api/verify/' + sha256, {}) -} +) -export const postVerification = data => dispatch => { +export const postVerification = data => dispatch => ( api(dispatch, post, 'address', '/api/verify/add', data) -} +) + |
