summaryrefslogtreecommitdiff
path: root/client/actions.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-04-28 17:12:15 +0200
committerJules Laplace <julescarbon@gmail.com>2019-04-28 17:12:15 +0200
commitd349e62cf53eda4b1a6b3cdc75ae9302dc2d4d5d (patch)
tree84a978c41c2c585b68a3eee3048785b5c3f60d6c /client/actions.js
parentece8612b7077d1a71de21badb43d94b8af3ab10a (diff)
browse by clicking results
Diffstat (limited to 'client/actions.js')
-rw-r--r--client/actions.js10
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