Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Fixed) Bug Report: Filters "greaterThan" / "greaterThanEqual" treat all input as numbers #1246

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
(Fix) Bug Report: Filters "greaterThan" / "greaterThanEqual" treat al…
…l input as numbers

Fixes #1175
iamAyushChamoli committed Jul 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 184ccc5d7031f69bb5fc6e3a3641b6c4bb256dc3
4 changes: 2 additions & 2 deletions src/lib/components/filters/store.ts
Original file line number Diff line number Diff line change
@@ -117,12 +117,12 @@ export const operators: Record<string, Operator> = {
types: ['string']
},
'greater than': {
toQuery: (attr, input) => Query.greaterThan(attr, Number(input)),
toQuery: Query.greaterThan,
toTag: (attribute, input) => `**${attribute}** greater than **${input}**`,
types: ['integer', 'double', 'datetime']
},
'greater than or equal': {
toQuery: (attr, input) => Query.greaterThanEqual(attr, Number(input)),
toQuery: Query.greaterThanEqual,
toTag: (attribute, input) => `**${attribute}** greater than or equal to **${input}**`,
types: ['integer', 'double', 'datetime']
},