I have an array like this .
{
"filters": [
{
"filterProperty": "companyType",
"filterValues": [
"Private"
]
},
{
"filterProperty": "city",
"filterValues": [
"Mumbai",
"SanJose",
"Shanghai"
]
}
]
}
I have applied Filters. now I am removing them One by One and calling an API with remaining Filters.
so when I pass filterProperty as "city" and value as "Mumbai" then only "Mumbai" would remove from filterProperty "city" . the rest filter values should be same.
How can I do so ?
"filters": [
{
"filterProperty": "companyType",
"filterValues": [
"Private"
]
},
{
"filterProperty": "city",
"filterValues": [
"Mumbai",
"SanJose",
"Shanghai"
]
}
]
let data = filters.splice(a=> a.filterProperty === 'city' && a.filterValues.filter(a => a == "Mumbai"))