Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
case insensitive full string search for file browser (#10431)
Browse files Browse the repository at this point in the history
Co-authored-by: Hanzla Mateen <[email protected]>
  • Loading branch information
aditya-mitra and hanzlamateen authored Jun 25, 2024
1 parent c4d2b0a commit 06a06b9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ export class FileBrowserService
let result = await storageProvider.listFolderContent(directory)
Object.entries(params.query).forEach(([key, value]) => {
if (value['$like']) {
const searchString = value['$like'].replace(/%/g, '')
result = result.filter((item) => item[key].includes(searchString))
result = result.filter(
(item) =>
(item[key] as string).search(new RegExp((value['$like'] as string).replaceAll('%', ''), 'gi')) !== -1
)
}
})

Expand Down

0 comments on commit 06a06b9

Please sign in to comment.