Browse Source

fix: neq filter issue with Links

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 2 years 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) => {}; return (_qb) => {};
} else if (column.uidt === UITypes.Lookup) { } else if (column.uidt === UITypes.Lookup) {
return await generateLookupCondition(column, filter, knex, aliasCount); 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 = ( const builder = (
await genRollupSelectv2({ await genRollupSelectv2({
knex, knex,
@ -447,9 +450,10 @@ const parseConditionV2 = async (
].includes(column.uidt) ].includes(column.uidt)
) { ) {
qb = qb.where((nestedQb) => { qb = qb.where((nestedQb) => {
nestedQb nestedQb.whereNot(field, val);
.whereNot(field, val)
.orWhereNull(customWhereClause ? _val : _field); if (column.uidt !== UITypes.Links)
qb.orWhereNull(customWhereClause ? _val : _field);
}); });
} else if (column.uidt === UITypes.Rating) { } else if (column.uidt === UITypes.Rating) {
// unset rating is considered as NULL // unset rating is considered as NULL
@ -469,9 +473,10 @@ const parseConditionV2 = async (
} }
} else { } else {
qb = qb.where((nestedQb) => { qb = qb.where((nestedQb) => {
nestedQb nestedQb.whereNot(field, val);
.whereNot(field, val)
.orWhereNull(customWhereClause ? _val : _field); if (column.uidt !== UITypes.Links)
qb.orWhereNull(customWhereClause ? _val : _field);
}); });
} }
break; break;

Loading…
Cancel
Save