Browse Source

fix: neq filter issue with Links

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
ae36fe7f08
  1. 19
      packages/nocodb/src/db/conditionV2.ts

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

@ -275,7 +275,10 @@ const parseConditionV2 = async (
return (_qb) => {};
} else if (column.uidt === UITypes.Lookup) {
return await generateLookupCondition(column, filter, knex, aliasCount);
} else if ([UITypes.Rollup,UITypes.Links].includes(column.uidt ) && !customWhereClause) {
} else if (
[UITypes.Rollup, UITypes.Links].includes(column.uidt) &&
!customWhereClause
) {
const builder = (
await genRollupSelectv2({
knex,
@ -447,9 +450,10 @@ const parseConditionV2 = async (
].includes(column.uidt)
) {
qb = qb.where((nestedQb) => {
nestedQb
.whereNot(field, val)
.orWhereNull(customWhereClause ? _val : _field);
nestedQb.whereNot(field, val);
if (column.uidt !== UITypes.Links)
qb.orWhereNull(customWhereClause ? _val : _field);
});
} else if (column.uidt === UITypes.Rating) {
// unset rating is considered as NULL
@ -469,9 +473,10 @@ const parseConditionV2 = async (
}
} else {
qb = qb.where((nestedQb) => {
nestedQb
.whereNot(field, val)
.orWhereNull(customWhereClause ? _val : _field);
nestedQb.whereNot(field, val);
if (column.uidt !== UITypes.Links)
qb.orWhereNull(customWhereClause ? _val : _field);
});
}
break;

Loading…
Cancel
Save