Browse Source

handle blank and notblank for formulas

pull/9759/head
DarkPhoenix2704 3 weeks ago
parent
commit
f63dd8b6cc
  1. 19
      packages/nocodb/src/db/conditionV2.ts

19
packages/nocodb/src/db/conditionV2.ts

@ -1200,6 +1200,16 @@ const parseConditionV2 = async (
.whereNull(customWhereClause || field) .whereNull(customWhereClause || field)
.orWhere(field, '[]') .orWhere(field, '[]')
.orWhere(field, 'null'); .orWhere(field, 'null');
} else if (column.uidt === UITypes.Formula) {
qb = qb.whereNull(customWhereClause || field);
if (
![UITypes.DateTime, UITypes.Number, UITypes.Checkbox].includes(
getEquivalentUIType({ formulaColumn: column }) || column.uidt,
)
) {
qb = qb.orWhere(field, '');
}
} else { } else {
qb = qb.whereNull(customWhereClause || field); qb = qb.whereNull(customWhereClause || field);
if ( if (
@ -1222,6 +1232,15 @@ const parseConditionV2 = async (
.whereNotNull(customWhereClause || field) .whereNotNull(customWhereClause || field)
.whereNot(field, '[]') .whereNot(field, '[]')
.whereNot(field, 'null'); .whereNot(field, 'null');
} else if (column.uidt === UITypes.Formula) {
qb = qb.whereNotNull(customWhereClause || field);
if (
![UITypes.DateTime, UITypes.Number, UITypes.Checkbox].includes(
getEquivalentUIType({ formulaColumn: column }) || column.uidt,
)
) {
qb = qb.whereNot(customWhereClause || field, '');
}
} else { } else {
qb = qb.whereNotNull(customWhereClause || field); qb = qb.whereNotNull(customWhereClause || field);
if ( if (

Loading…
Cancel
Save