import { List } from 'immutable';

export function getProductsToShow(state, categoryCode, productIds) {
  if (state.has(categoryCode)) {
    return state.get(categoryCode).filter(p => productIds.includes(p.get('code')));
  }
  return List();
}

import { List } from 'immutable';

export function getProductsToShow(state, categoryCode, productIds) {
  if (state.has(categoryCode)) {
    if (productIds.isEmpty()) {
      return state.get(categoryCode);
    }
    return state.get(categoryCode).filter(p => productIds.includes(p.get('code')));
  }
  return List();
}

fix problem with getProductsToShow, now returning all products if no aids are selected