I’ve tried to add another value (organization.name) to my already successfully working searchbar, so that not only the list of SearchTerms from my organization.topic were filtered. But he doesnt add it..
const filteredOrganizations = context.allOrganizations.filter((organization) => (organization.topic.searchTerms
.map((term) => term.toLowerCase())
.join(" ") ||
organization.name)
.includes(searchText.toLowerCase()))
thats the relevant part of my return:
<TableBody>
{filteredOrganizations.map((organization) => (
<StyledTableRow key={organization.id}>
...
I hope you have an idea
2
Answers
Don’t use
||
since you want to check also the organization name.Just concatenate the strings