Skip to content

Commit

Permalink
Revert "Notes: Make filter by query case insensitive"
Browse files Browse the repository at this point in the history
This reverts commit a99f6ce.

Apparently this is not a bug but a feature :-D
  • Loading branch information
tordans committed Aug 8, 2024
1 parent 17fd255 commit 3b5976a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/src/notes/queries/getNotesAndCommentsForRegion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,11 @@ export default resolver.pipe(
// Filter by `query` on note.body/subject or any note.comment.body
filteredNotes = filteredNotes.filter((note) => {
if (typeof filter.query !== 'string') return true
const query = filter.query.toLocaleLowerCase()
const fullNote = notes.find((fNote) => fNote.id == note.properties.id)
if (fullNote?.subject?.toLocaleLowerCase()?.includes(query)) return true
if (fullNote?.body?.toLocaleLowerCase()?.includes(query)) return true
const anyComment = fullNote?.noteComments?.some((c) => {
return query && c.body.toLocaleLowerCase().includes(query)
})
if (anyComment) return true
if (fullNote?.subject?.includes(filter.query)) return true
if (fullNote?.body?.includes(filter.query)) return true
if (fullNote?.noteComments?.some((c) => filter.query && c.body.includes(filter.query)))
return true
return false
})
// Filter by `completed` on note.status
Expand Down

0 comments on commit 3b5976a

Please sign in to comment.