Browse Source

fix: handle null & not null for filter on bt cells

pull/2535/head
Wing-Kam Wong 3 years ago
parent
commit
44d25523fa
  1. 11
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts

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

@ -111,6 +111,17 @@ const parseConditionV2 = async (
else qbP.whereIn(parentColumn.column_name, selectQb); else qbP.whereIn(parentColumn.column_name, selectQb);
}; };
} else if (colOptions.type === RelationTypes.BELONGS_TO) { } else if (colOptions.type === RelationTypes.BELONGS_TO) {
if (filter.comparison_op === 'null') {
return (qb) => {
qb.whereNull(childColumn.column_name);
};
}
if (filter.comparison_op === 'notnull') {
return (qb) => {
qb.whereNotNull(childColumn.column_name);
};
}
const selectQb = knex(parentModel.table_name).select( const selectQb = knex(parentModel.table_name).select(
parentColumn.column_name parentColumn.column_name
); );

Loading…
Cancel
Save