Browse Source

feat(nocodb): add blank & notblank logic

pull/5106/head
Wing-Kam Wong 2 years ago
parent
commit
a1227609f9
  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

@ -480,7 +480,6 @@ const parseConditionV2 = async (
case 'lte': case 'lte':
qb = qb.where(field, customWhereClause ? '>=' : '<=', val); qb = qb.where(field, customWhereClause ? '>=' : '<=', val);
break; break;
case 'empty': case 'empty':
if (column.uidt === UITypes.Formula) { if (column.uidt === UITypes.Formula) {
[field, val] = [val, field]; [field, val] = [val, field];
@ -499,6 +498,14 @@ const parseConditionV2 = async (
case 'notnull': case 'notnull':
qb = qb.whereNotNull(customWhereClause || field); qb = qb.whereNotNull(customWhereClause || field);
break; break;
case 'blank':
qb = qb.whereNull(customWhereClause || field).orWhere(field, '');
break;
case 'notblank':
qb = qb
.whereNotNull(customWhereClause || field)
.whereNot(field, '');
break;
case 'checked': case 'checked':
qb = qb.where(customWhereClause || field, true); qb = qb.where(customWhereClause || field, true);
break; break;

Loading…
Cancel
Save