I am doing a project using React-Redux and am quite new to it. I have a JSON object which looks like this
{
  "topLevel": {
    "
    "Title": "Title Text",
    "Content": "",
    "Categories": [
      "123",
      "456",
      "789",
    ]
  },
"NextLevel": [
    {
      "ID": "123",
      "Name": "ValentinesDay",
      "Type": 0,
      ]
    },
    {
      "ID": "456",
      "Name": "Family Meals",
      "Title": "Family Meals",
    },
 {
      "ID": "999",
      "Name": "sample",
      "Title": "sample",
    },
{
      "ID": "789",
      "Name": "sample",
      "Title": "sample",
    },
I need to find a way to iterate through the TopLevel and find matchingIds in the second one and display those elements on the DOM.
My reducers looks like this now
switch (action.type) {
    case RECEIVE_PRODUCTS:
      return {
        ...state,
        ...action.products.NextLevel.reduce((obj, product) => {
          obj[product.ID] = product;
          return obj;
        }, {})
      }
    default:
      return state
this displays all the elements in the NextLevel object. How do I include a condition that ensures I pickup only IDS that have been listed in First Level?
