Browse Source

fix(nocodb): disable filtering if empty value is given for date & datetimes

pull/5185/head
Wing-Kam Wong 2 years ago
parent
commit
00ab683b94
  1. 9
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts

9
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts

@ -271,13 +271,8 @@ const parseConditionV2 = async (
return (qb: Knex.QueryBuilder) => {
let [field, val] = [_field, _val];
if (
[UITypes.Date, UITypes.DateTime].includes(column.uidt) &&
!val &&
['is', 'isnot'].includes(filter.comparison_op)
) {
// for date & datetime,
// val cannot be empty for non-is & non-isnot filters
if ([UITypes.Date, UITypes.DateTime].includes(column.uidt) && !val) {
// for date & datetime, val cannot be empty for all filters
return;
}

Loading…
Cancel
Save