From d349e62cf53eda4b1a6b3cdc75ae9302dc2d4d5d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 28 Apr 2019 17:12:15 +0200 Subject: browse by clicking results --- client/actions.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'client/actions.js') 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 -- cgit v1.2.3-70-g09d2