summaryrefslogtreecommitdiff
path: root/scraper/client/actions.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-03-20 01:48:55 +0100
committerJules Laplace <julescarbon@gmail.com>2019-03-20 01:48:55 +0100
commite5c69daa3c2428a067c61baca3d20c96398f9354 (patch)
treec97bdc78d53a7b058c23deeadfdbe3a11ad7a1cf /scraper/client/actions.js
parent7eb3c04ef85fa0311bdf30b24df2aba102757878 (diff)
s2 geocode server
Diffstat (limited to 'scraper/client/actions.js')
-rw-r--r--scraper/client/actions.js12
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)
-}
+)
+