deep subcategory solution
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { SUBCATEGORY_SELECT, CATEGORY_SELECT } from "constants/actionTypes";
|
||||
|
||||
export default (state = null, action) => {
|
||||
switch (action.type) {
|
||||
case SUBCATEGORY_SELECT:
|
||||
return action.option;
|
||||
case CATEGORY_SELECT:
|
||||
return null;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
export default (state = {}, action) => {
|
||||
switch (action.type) {
|
||||
case SUBCATEGORY_SELECT:
|
||||
return { ...state, [action.option.depth]: action.option.selectedOption };
|
||||
case CATEGORY_SELECT:
|
||||
return {};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user