Browse Source

fix: avoid mutating variable by keeping local variable

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2680/head
Pranav C 2 years ago
parent
commit
7ef852f060
  1. 5
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts

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

@ -261,16 +261,17 @@ const parseConditionV2 = async (
filter.comparison_op === 'notempty'
)
filter.value = '';
let field = sanitize(
const _field = sanitize(
customWhereClause
? filter.value
: alias
? `${alias}.${column.column_name}`
: column.column_name
);
let val = customWhereClause ? customWhereClause : filter.value;
const _val = customWhereClause ? customWhereClause : filter.value;
return (qb) => {
let [field, val] = [_field, _val];
switch (filter.comparison_op) {
case 'eq':
qb = qb.where(field, val);

Loading…
Cancel
Save