Skip to content

Commit

Permalink
Update meinberlin/react/plans/use-create-search-profile.js
Browse files Browse the repository at this point in the history
Co-authored-by: Philipp <[email protected]>
  • Loading branch information
sevfurneaux and vellip authored Jan 15, 2025
1 parent e992941 commit 79f3b00
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions meinberlin/react/plans/use-create-search-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,38 +86,22 @@ function getFilteredResults ({
participationChoices,
projectStatus
}) {
const filters = [
districts.filter(district =>
return {
filteredDistricts: districts.filter(district =>
appliedFilters.districts.includes(district.name)
),
organisations.filter(organisation =>
filteredOrganisations: organisations.filter(organisation =>
appliedFilters.organisation.includes(organisation.name)
),
topicChoices.filter(topic =>
filteredTopics: topicChoices.filter(topic =>
appliedFilters.topics.includes(topic.code)
),
appliedFilters.participations.map(index =>
filteredParticipationChoices: appliedFilters.participations.map(index =>
participationChoices[index]
),
projectStatus.filter(status =>
filteredProjectStatus: projectStatus.filter(status =>
appliedFilters.projectState.includes(STATUS_MAPPING[status.name])
)
]

const [
filteredDistricts,
filteredOrganisations,
filteredTopics,
filteredParticipationChoices,
filteredProjectStatus
] = filters

return {
filteredDistricts,
filteredOrganisations,
filteredTopics,
filteredParticipationChoices,
filteredProjectStatus
}
}

Expand Down

0 comments on commit 79f3b00

Please sign in to comment.