I have an object which looks something like this:
activeFilters: {
category: {
'1': 'View All',
'2': ' Flats'
},
brand: {
'1': 'Fits'
}
}
I want to map through the object and use these as URL parameters. The end result will look something like this:
https://api.websiteurl.com/products?category=1,2&brand=1
I am using react and I can use lodash. Wanted help on whats the best way to achieve this
categoryandbrandreallyobjectvalues and not Arrays? It's unusual to have numeric property keys inobjectvalues.https://api.websiteurl.com/products&category=1,2&brand=1<-- This is an invalid URI, you're missing the querystring?character.{...state.filters, [action.id]: [action.name]}