Skip to content

Commit

Permalink
fix: update getGistFilterParams function in useQueries file for user …
Browse files Browse the repository at this point in the history
…search
  • Loading branch information
Chisomchima committed Mar 22, 2024
1 parent aab4af0 commit 20b5ad5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/components/GroupForm/BulkUserManager/useQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useMemo } from 'react'
// split the filter into space-separated tokens and filter by those tokens. A
// filter group is created for each token, with filters within each group being
// combined with a logical OR and the groups being combined with a logical AND.
const getGistFilterParams = (filterQuery) => {
const filterTokens = filterQuery.split(' ')
const getGistFilterParams = filterQuery => {
const filterTokens = filterQuery.split('')
let filter = undefined
if (filterQuery !== '') {
filter = filterTokens.flatMap((token, index) => {
Expand All @@ -14,9 +14,7 @@ const getGistFilterParams = (filterQuery) => {
}

const filterFields = ['firstName', 'surname', 'username']
return filterFields.map(
(field) => `${index}:${field}:ilike:${token}`
)
return filterFields.map(field => `${index}:${field}:ilike:${token}`)
})
}

Expand Down

0 comments on commit 20b5ad5

Please sign in to comment.