I tried adding another value (organization.name) to the search bar which was already running successfully, in order to not only filter the list of SearchTerms from organization.topic. But he didn't add it..
const filteredOrganizations = context.allOrganizations.filter((organization) => (organization.topic.searchTerms .map((term) => term.toLowerCase()) .join(" ") || organization.name) .includes(searchText.toLowerCase()))
Here are the relevant parts of my return:
<TableBody> {filteredOrganizations.map((organization) => ( <StyledTableRow key={organization.id}> ...
Hope you have some ideas
Do not use
||
as you also want to check the organization name. Just concatenate the stringsThis is the solution: