mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
Merge global search.
This commit is contained in:
@@ -8,26 +8,11 @@ const initialState = {
|
||||
};
|
||||
|
||||
export default createReducer(initialState, {
|
||||
[t.SEARCH_SUCCESS]: (state, action) => {
|
||||
const _result = {};
|
||||
|
||||
action.searches.forEach((search) => {
|
||||
_result[search.id] = search;
|
||||
});
|
||||
|
||||
state.searches = {
|
||||
...state.searches,
|
||||
..._result,
|
||||
};
|
||||
[t.OPEN_SEARCH]: (state, action) => {
|
||||
state.isOpen = true;
|
||||
},
|
||||
});
|
||||
|
||||
// return state = action.result;
|
||||
// if (typeof state === 'undefined') {
|
||||
// return initialState;
|
||||
// }
|
||||
|
||||
// state.search[action.name] = {
|
||||
// isOpen: true,
|
||||
// payload: action.payload || {},
|
||||
// };
|
||||
[t.CLOSE_SEARCH]: (state, action) => {
|
||||
state.isOpen = false;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user