[actions, reducers] onSale 관련 logic 추가
Detail Notes : 1. action type 추가 (COPY_CATEGORY_INFO) 2. reducer 수정 (copiedCategoryInfos)
This commit is contained in:
@@ -88,6 +88,7 @@ export const types = {
|
||||
|
||||
// onSale actions
|
||||
GET_ON_SALE_INFO: "GET_ON_SALE_INFO",
|
||||
COPY_CATEGORY_INFO: "COPY_CATEGORY_INFO",
|
||||
|
||||
// product actions
|
||||
GET_BEST_SELLER: "GET_BEST_SELLER",
|
||||
|
||||
@@ -42,3 +42,8 @@ export const getOnSaleInfo = (props) => (dispatch, getState) => {
|
||||
onFail
|
||||
);
|
||||
};
|
||||
|
||||
export const copyCategoryInfos = (categoryInfos) => ({
|
||||
type: types.COPY_CATEGORY_INFO,
|
||||
payload: categoryInfos,
|
||||
});
|
||||
|
||||
@@ -5,6 +5,8 @@ const initialState = {
|
||||
data: {},
|
||||
status: "idle",
|
||||
},
|
||||
|
||||
copiedCategoryInfos: [],
|
||||
};
|
||||
|
||||
export const onSaleReducer = (state = initialState, action) => {
|
||||
@@ -15,6 +17,12 @@ export const onSaleReducer = (state = initialState, action) => {
|
||||
onSaleData: action.payload,
|
||||
};
|
||||
|
||||
case types.COPY_CATEGORY_INFO:
|
||||
return {
|
||||
...state,
|
||||
copiedCategoryInfos: action.payload,
|
||||
};
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user