diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-04-28 17:12:15 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-04-28 17:12:15 +0200 |
| commit | d349e62cf53eda4b1a6b3cdc75ae9302dc2d4d5d (patch) | |
| tree | 84a978c41c2c585b68a3eee3048785b5c3f60d6c /client/actions.js | |
| parent | ece8612b7077d1a71de21badb43d94b8af3ab10a (diff) | |
browse by clicking results
Diffstat (limited to 'client/actions.js')
| -rw-r--r-- | client/actions.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/client/actions.js b/client/actions.js index 3fee515..5f396e2 100644 --- a/client/actions.js +++ b/client/actions.js @@ -8,7 +8,7 @@ export const api = (dispatch, method, tag, url, params, after) => { dispatch({ type: types.api.loaded, tag, data }) return data }).catch(err => { - dispatch({ type: types.api.error, tag, err }) + dispatch({ type: types.api.error, tag, error }) }) } @@ -19,16 +19,20 @@ export const upload = (blob, threshold) => dispatch => { api(dispatch, post, 'similar', '/api/v1/similar', params) } -export const submit = (url, threshold) => dispatch => { +export const similar = (url, threshold) => dispatch => { const params = new FormData() params.append('url', url) params.append('threshold', threshold) api(dispatch, post, 'similar', '/api/v1/similar', params) } -export const submit = (url, threshold) => dispatch => { +export const match = (url, threshold) => dispatch => { const params = new FormData() params.append('url', url) params.append('threshold', threshold) api(dispatch, post, 'similar', '/api/v1/match', params) } + +export const updateQuery = state => dispatch => { + dispatch({ type: types.api.updateQuery, state }) +}
\ No newline at end of file |
