Skip to content

Commit

Permalink
[#582] make proposal/list search case insensitive
Browse files Browse the repository at this point in the history
Signed-off-by: jankun4 <michaljankun@gmail.com>
  • Loading branch information
jankun4 committed Mar 28, 2024
1 parent 75dbcb9 commit a7e6742
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ changes.

### Fixed

- proposal/list search is case insensitive now [Issue 582](https://github.com/IntersectMBO/govtool/issues/582)
- proposal/list now takes optional `search` query param [Issue 566](https://github.com/IntersectMBO/govtool/issues/566)
- Fix possible sql error when there would be no predefined drep voting pwoer [Issue 501](https://github.com/IntersectMBO/govtool/issues/501)
- Fix drep type detection when changing metadata [Issue 333](https://github.com/IntersectMBO/govtool/issues/333)
Expand Down
10 changes: 5 additions & 5 deletions govtool/backend/src/VVA/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ listProposals selectedTypes sortMode mPage mPageSize mDrepRaw mSearchQuery = do



let filterF ProposalResponse{..} = case mSearchQuery of
let filterF ProposalResponse{..} = case Text.toLower <$> mSearchQuery of
Nothing -> True
Just searchQuery -> fromMaybe False $ do
title <- proposalResponseTitle
about <- proposalResponseAbout
motivation <- proposalResponseMotivation
rationale <- proposalResponseRationale
title <- Text.toLower <$> proposalResponseTitle
about <- Text.toLower <$> proposalResponseAbout
motivation <- Text.toLower <$> proposalResponseMotivation
rationale <- Text.toLower <$> proposalResponseRationale

let result = searchQuery `isInfixOf` title
|| searchQuery `isInfixOf` about
Expand Down

0 comments on commit a7e6742

Please sign in to comment.