From e5c69daa3c2428a067c61baca3d20c96398f9354 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 20 Mar 2019 01:48:55 +0100 Subject: s2 geocode server --- scraper/client/actions.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'scraper/client/actions.js') 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) -} +) + -- cgit v1.2.3-70-g09d2