diff options
Diffstat (limited to 'client/store.js')
| -rw-r--r-- | client/store.js | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/client/store.js b/client/store.js index c5f5555..802a47b 100644 --- a/client/store.js +++ b/client/store.js @@ -5,7 +5,18 @@ import thunk from 'redux-thunk' import * as types from './types' const initialState = () => ({ - api: null, + query: { + image: null, + blob: null, + url: "", + threshold: types.SIMILAR_THRESHOLD, + searchType: 'file', + thresholdChanged: false, + saveIfNotFound: false, + }, + api: { + similar: {} + }, }) export default function apiReducer(state = initialState(), action) { @@ -26,7 +37,16 @@ export default function apiReducer(state = initialState(), action) { case types.api.error: return { ...state, - [action.tag]: { error: action.err }, + [action.tag]: { error: action.error }, + } + + case types.api.updateQuery: + return { + ...state, + query: { + ...state.query, + ...action.state, + }, } default: |
