diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-03-28 14:45:07 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-03-28 14:45:07 +0100 |
| commit | ad6284a2040837e7373b4d89644a01306f181dd5 (patch) | |
| tree | 9fde7c1669ee92004cd990496634221dda42e8dd /scraper/client/actions.js | |
| parent | 1c25e681184dd3c61a6296d5cebb4e5883b072f0 (diff) | |
fetch papers by single dataset
Diffstat (limited to 'scraper/client/actions.js')
| -rw-r--r-- | scraper/client/actions.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scraper/client/actions.js b/scraper/client/actions.js index 734a8cbd..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 => { @@ -36,6 +37,10 @@ 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, {}) ) |
