Browse Source

fix: simplify condition

pull/9759/head
DarkPhoenix2704 4 weeks ago
parent
commit
4773236c70
  1. 11
      packages/nocodb/src/db/conditionV2.ts

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

@ -1202,11 +1202,9 @@ const parseConditionV2 = async (
.orWhere(field, 'null'); .orWhere(field, 'null');
} else if (column.uidt === UITypes.Formula) { } else if (column.uidt === UITypes.Formula) {
qb = qb.whereNull(customWhereClause || field); qb = qb.whereNull(customWhereClause || field);
if ( if (
![UITypes.DateTime, UITypes.Number, UITypes.Checkbox].includes( (column?.colOptions as any).parsed_tree?.dataType ===
getEquivalentUIType({ formulaColumn: column }) || column.uidt, FormulaDataTypes.STRING
)
) { ) {
qb = qb.orWhere(field, ''); qb = qb.orWhere(field, '');
} }
@ -1235,9 +1233,8 @@ const parseConditionV2 = async (
} else if (column.uidt === UITypes.Formula) { } else if (column.uidt === UITypes.Formula) {
qb = qb.whereNotNull(customWhereClause || field); qb = qb.whereNotNull(customWhereClause || field);
if ( if (
![UITypes.DateTime, UITypes.Number, UITypes.Checkbox].includes( (column?.colOptions as any).parsed_tree?.dataType ===
getEquivalentUIType({ formulaColumn: column }) || column.uidt, FormulaDataTypes.STRING
)
) { ) {
qb = qb.whereNot(customWhereClause || field, ''); qb = qb.whereNot(customWhereClause || field, '');
} }

Loading…
Cancel
Save