Skip to content

Commit

Permalink
Correctly filter incidents on map
Browse files Browse the repository at this point in the history
  • Loading branch information
bartjkdp committed Nov 24, 2022
1 parent f0dd80c commit 347c670
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const getFilteredIncidents = (
const activeSlugs = activeFilters.map((filter) => filter.slug)

const activeIncidents = incidents.filter((incident) => {
return activeSlugs.includes(incident.properties.category.slug)
return activeSlugs.includes(incident.properties.category.parent.slug)
})

const listedIcons = getListOfIcons(activeFilters)

return activeIncidents.map((incident) => {
const slug = incident.properties.category.slug
const slug = incident.properties.category.parent.slug

const icon = listedIcons.find((iconObj) => iconObj.slug === slug)
if (icon?.icon) {
Expand Down

0 comments on commit 347c670

Please sign in to comment.