From 246bae73ebc0e201b06626e8e4a17502d57c7452 Mon Sep 17 00:00:00 2001 From: ae-giddy Date: Fri, 7 Oct 2022 15:50:16 -0600 Subject: [PATCH 1/2] Add bigint filter --- src/utils/filter/bigint-filter.parser.ts | 7 +++++++ src/utils/filter/filter.utils.ts | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 src/utils/filter/bigint-filter.parser.ts diff --git a/src/utils/filter/bigint-filter.parser.ts b/src/utils/filter/bigint-filter.parser.ts new file mode 100644 index 00000000..d290a0f8 --- /dev/null +++ b/src/utils/filter/bigint-filter.parser.ts @@ -0,0 +1,7 @@ +import { Property } from '../../Property' +import { FilterParser } from './filter.types' + +export const BigintParser: FilterParser = { + isParserForType: (filter) => (filter.property as Property).column.type === 'bigint', + parse: (filter, fieldKey) => ({ filterKey: fieldKey, filterValue: filter.value }), +} \ No newline at end of file diff --git a/src/utils/filter/filter.utils.ts b/src/utils/filter/filter.utils.ts index 41726c38..b7ad1349 100644 --- a/src/utils/filter/filter.utils.ts +++ b/src/utils/filter/filter.utils.ts @@ -1,3 +1,4 @@ +import { BigintParser } from './bigint-filter.parser' import { CustomParser } from './custom-filter.parser' import { DateParser } from './date-filter.parser' import { EnumParser } from './enum-filter.parser' @@ -15,6 +16,7 @@ export const safeParseJSON = (json: string): any | null => { export const parsers = [ // Has to be the first one, as it is intended to use custom filter if user overrides that CustomParser, + BigintParser, DateParser, EnumParser, ReferenceParser, From 38bf60a4e28dab57391a874b37e725d1e1477e58 Mon Sep 17 00:00:00 2001 From: ae-giddy Date: Fri, 7 Oct 2022 15:52:21 -0600 Subject: [PATCH 2/2] Add newline --- src/utils/filter/bigint-filter.parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/filter/bigint-filter.parser.ts b/src/utils/filter/bigint-filter.parser.ts index d290a0f8..699f24cb 100644 --- a/src/utils/filter/bigint-filter.parser.ts +++ b/src/utils/filter/bigint-filter.parser.ts @@ -4,4 +4,4 @@ import { FilterParser } from './filter.types' export const BigintParser: FilterParser = { isParserForType: (filter) => (filter.property as Property).column.type === 'bigint', parse: (filter, fieldKey) => ({ filterKey: fieldKey, filterValue: filter.value }), -} \ No newline at end of file +}