summaryrefslogtreecommitdiff
path: root/scraper/client/actions.js
diff options
context:
space:
mode:
Diffstat (limited to 'scraper/client/actions.js')
-rw-r--r--scraper/client/actions.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/scraper/client/actions.js b/scraper/client/actions.js
index 6c4e16b2..1b5152ea 100644
--- a/scraper/client/actions.js
+++ b/scraper/client/actions.js
@@ -1,9 +1,10 @@
import { get, post } from './util'
import * as types from './types'
-export const api = (dispatch, method, tag, url, params) => {
+export const api = (dispatch, method, tag, url, params, after) => {
dispatch({ type: types.api.loading, tag })
return method(url, params).then(data => {
+ if (after) data = after(data)
dispatch({ type: types.api.loaded, tag, data })
return data
}).catch(err => {
@@ -32,6 +33,14 @@ export const postAddress = data => dispatch => {
api(dispatch, post, 'address', '/api/address/add', data)
}
+export const getVerifications = () => dispatch => (
+ api(dispatch, get, 'verifications', '/api/verifications', {})
+)
+
+export const getVerificationsDataset = dataset => dispatch => (
+ api(dispatch, get, 'verifications', '/api/verifications/' + dataset, {})
+)
+
export const getVerification = sha256 => dispatch => (
api(dispatch, get, 'verify', '/api/verify/' + sha256, {})
)