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.comparison_op === 'notempty'
) )
filter.value = ''; filter.value = '';
let field = sanitize( const _field = sanitize(
customWhereClause customWhereClause
? filter.value ? filter.value
: alias : alias
? `${alias}.${column.column_name}` ? `${alias}.${column.column_name}`
: column.column_name : column.column_name
); );
let val = customWhereClause ? customWhereClause : filter.value; const _val = customWhereClause ? customWhereClause : filter.value;
return (qb) => { return (qb) => {
let [field, val] = [_field, _val];
switch (filter.comparison_op) { switch (filter.comparison_op) {
case 'eq': case 'eq':
qb = qb.where(field, val); qb = qb.where(field, val);

Loading…
Cancel
Save