Implement shop search and refactor

This commit is contained in:
Almira Krdzic
2018-10-17 00:36:19 +02:00
parent afab22a30b
commit 8769606a4b
24 changed files with 379 additions and 182 deletions

View File

@@ -16,7 +16,7 @@ class CoMarketCatalogSelect extends Component {
}
componentDidMount() {
this.props.dispatch(fetchShops());
this.props.dispatch(fetchShops(this.props.userInfo.wiaas_id_user));
if(this.props.shops && this.props.cartItems && this.props.activeModule==='cart'){
const cartShop = this.props.shops.find( shop => { return shop.id===this.props.cartItems[0].idCommercialLead });
@@ -80,7 +80,8 @@ const mapStateToProps = (state) => ({
selectedShop: state.coMarketPackagesReducer.selectedShop,
idPackage: state.coMarketReducer.idPackage,
cartItems: state.cartReducer.cartItems,
activeSubmodule: state.pageReducer.activeSubmodule
activeSubmodule: state.pageReducer.activeSubmodule,
userInfo: state.auth.userInfo
});
export default connect(mapStateToProps)(CoMarketCatalogSelect);