Browse Source

refactor: type correction

pull/6987/head
Pranav C 1 year ago
parent
commit
3397e0cfeb
  1. 8
      packages/nocodb/src/db/conditionV2.ts

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

@ -120,8 +120,8 @@ const parseConditionV2 = async (
// aggregated value will be either json array or `___` separated string
// `gb_null` is equivalent to `blank` but for lookup it compares on aggregated value is null
if (
filter.comparison_op === 'gb_eq' ||
filter.comparison_op === 'gb_null'
(filter.comparison_op as any) === 'gb_eq' ||
(filter.comparison_op as any) === 'gb_null'
) {
const column = await filter.getColumn();
if (
@ -137,13 +137,13 @@ const parseConditionV2 = async (
getAlias: getAliasGenerator('__gb_filter_lk'),
});
return (qb) => {
if (filter.comparison_op === 'gb_eq')
if ((filter.comparison_op as any) === 'gb_eq')
qb.where(knex.raw('?', [filter.value]), lkQb.builder);
else qb.whereNull(knex.raw(lkQb.builder).wrap('(', ')'));
};
} else {
filter.comparison_op =
filter.comparison_op === 'gb_eq' ? 'eq' : 'blank';
(filter.comparison_op as any) === 'gb_eq' ? 'eq' : 'blank';
// if qrCode or Barcode replace it with value column
if ([UITypes.QrCode, UITypes.Barcode].includes(column.uidt))
filter.fk_column_id = await column

Loading…
Cancel
Save