2019-08-21 20:08:08 +02:00
|
|
|
import * as ActionTypes from '../../../constants';
|
|
|
|
|
|
|
|
const initialState = {
|
2019-11-10 21:39:22 +01:00
|
|
|
collectionSearchTerm: '',
|
|
|
|
sketchSearchTerm: ''
|
2019-08-21 20:08:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default (state = initialState, action) => {
|
|
|
|
switch (action.type) {
|
|
|
|
case ActionTypes.SET_SEARCH_TERM:
|
2019-11-10 21:39:22 +01:00
|
|
|
return { ...state, [`${action.scope}SearchTerm`]: action.query };
|
2019-08-21 20:08:08 +02:00
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|