Browse Source

fix: user field like condition

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/7202/head
mertmit 11 months ago
parent
commit
4ca20d0eb3
  1. 10
      packages/nocodb/src/db/conditionV2.ts

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

@ -495,7 +495,7 @@ const parseConditionV2 = async (
if (qb?.client?.config?.client === 'pg') {
qb = qb.where(knex.raw(`(${finalStatement}) ilike ?`, [val]));
} else {
qb = qb.where(finalStatement, 'like', val);
qb = qb.where(knex.raw(`(${finalStatement}) like ?`, [val]));
}
} else {
if (!val) {
@ -507,11 +507,13 @@ const parseConditionV2 = async (
qb.where((nestedQb) => {
if (qb?.client?.config?.client === 'pg') {
nestedQb.where(
knex.raw(`(${finalStatement}) not ilike ?`, [val]),
nestedQb.whereNot(
knex.raw(`(${finalStatement}) ilike ?`, [val]),
);
} else {
nestedQb.whereNot(finalStatement, 'like', val);
nestedQb.whereNot(
knex.raw(`(${finalStatement}) like ?`, [val]),
);
}
if (val !== '%%') {
// if value is not empty, empty or null should be included

Loading…
Cancel
Save