From e46289e8a3fc6bcf8dced180cbfa27fb166dd192 Mon Sep 17 00:00:00 2001 From: Vijay Rathore Date: Tue, 24 May 2022 07:55:55 +0200 Subject: [PATCH] fix: add btw and nbtw filters (#2129) Signed-off-by: Vijay Kumar Rathore --- packages/nocodb/src/lib/dataMapper/lib/sql/conditionV2.ts | 6 ++++++ packages/nocodb/src/lib/noco-models/Filter.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/conditionV2.ts b/packages/nocodb/src/lib/dataMapper/lib/sql/conditionV2.ts index eca1058825..d72dcea6a8 100644 --- a/packages/nocodb/src/lib/dataMapper/lib/sql/conditionV2.ts +++ b/packages/nocodb/src/lib/dataMapper/lib/sql/conditionV2.ts @@ -284,6 +284,12 @@ const parseConditionV2 = async ( case 'notnull': qb = qb.whereNotNull(customWhereClause || field); break; + case 'btw': + qb = qb.whereBetween(field, val.split(',')); + break; + case 'nbtw': + qb = qb.whereNotBetween(field, val.split(',')); + break; } }; } diff --git a/packages/nocodb/src/lib/noco-models/Filter.ts b/packages/nocodb/src/lib/noco-models/Filter.ts index b5376e9e18..e31929a2b2 100644 --- a/packages/nocodb/src/lib/noco-models/Filter.ts +++ b/packages/nocodb/src/lib/noco-models/Filter.ts @@ -37,7 +37,9 @@ export default class Filter { | 'le' | 'in' | 'isnot' - | 'is'; + | 'is' + | 'btw' + | 'nbtw'; value?: string; logical_op?: string;