Verified Commit 115a3b2a authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Fix search of groups on profile page

parent 7fe46857
Pipeline #58387 passed with stages
in 9 minutes and 58 seconds
......@@ -35,7 +35,6 @@ const ProfileGroupList = ({
setSearch(event.target.value)
}
const searchRegex = new RegExp(search)
let counter = 0
return (
......@@ -47,7 +46,7 @@ const ProfileGroupList = ({
onChange={handleSearchChange}
/>
{items.map(item => {
if (!itemSearchTest(item, searchRegex)) return null
if (!itemSearchTest(item, search)) return null
counter += 1
return (
<ItemComponent key={item._id} className={classes.row} item={item} />
......
......@@ -15,8 +15,8 @@ const ProfileGroupMemberships = props => {
dispatch(loadMemberships())
}, [])
const itemSearchTest = (item, searchRegex) => {
return searchRegex.test(item.group.name)
const itemSearchTest = (item, search) => {
return item.group.name.toLowerCase().includes(search.toLowerCase())
}
return (
......
......@@ -28,8 +28,8 @@ const ProfileGroupPublic = props => {
})
}, [membershipItems, groups])
const itemSearchTest = (item, searchRegex) => {
return searchRegex.test(item.name)
const itemSearchTest = (item, search) => {
return item.name.toLowerCase().includes(search.toLowerCase())
}
return (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment