Skip to content

Commit 886887f

Browse files
committed
add rating options to the reducer
1 parent 4b9dffb commit 886887f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/actions/types.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,5 @@ export const MAGENTO_RELATED_PRODUCTS_LOADING = 'magento_related_products_loadin
9898
export const MAGENTO_RELATED_PRODUCTS_SUCCESS = 'magento_related_products_success';
9999
export const MAGENTO_RELATED_PRODUCTS_ERROR = 'magento_related_products_error';
100100
export const MAGENTO_RELATED_PRODUCTS_CONF_PRODUCT = 'magento_related_products_conf_product_update';
101+
102+
export const MAGENTO_PRODUCT_RATING_OPTIONS = 'MAGENTO_PRODUCT_RATING_OPTIONS';

src/reducers/ProductReducer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
MAGENTO_RELATED_PRODUCTS_CONF_PRODUCT,
1616
} from '../actions/types';
1717
import { getPriceFromChildren } from '../helper/product';
18+
import * as types from '../actions/types';
1819

1920
const INITIAL_STATE = {
2021
current: {
@@ -32,6 +33,7 @@ const INITIAL_STATE = {
3233
error: '',
3334
items: [],
3435
},
36+
ratingOptions: [],
3537
};
3638

3739
export default (state = INITIAL_STATE, action) => {
@@ -169,6 +171,9 @@ export default (state = INITIAL_STATE, action) => {
169171
relatedProducts,
170172
};
171173
}
174+
case types.MAGENTO_PRODUCT_RATING_OPTIONS: {
175+
return { ...state, ratingOptions: action.payload };
176+
}
172177
default:
173178
return state;
174179
}

0 commit comments

Comments
 (0)