|
@@ -1,4 +1,4 @@
|
|
|
-import { SET_SEARCH_VALUE, GET_SEARCH_RESULT } from '../types/medicalInfo';
|
|
|
+import { SET_SEARCH_VALUE, GET_SEARCH_RESULT ,CLEAR_INFO_SEARCH_LIST} from '../types/medicalInfo';
|
|
|
import { setSearchValue, getSearchResult } from '../actions/medicalInfo';
|
|
|
|
|
|
const initState = {
|
|
@@ -7,11 +7,15 @@ const initState = {
|
|
|
}
|
|
|
|
|
|
export default function (state=initState, action) {
|
|
|
+ const res = Object.assign({},state);
|
|
|
switch(action.type) {
|
|
|
case SET_SEARCH_VALUE:
|
|
|
return setSearchValue(state, action);
|
|
|
case GET_SEARCH_RESULT:
|
|
|
return getSearchResult(state, action);
|
|
|
+ case CLEAR_INFO_SEARCH_LIST:
|
|
|
+ res.searchResult=[];
|
|
|
+ return res;
|
|
|
default:
|
|
|
return state;
|
|
|
}
|