From 7ca2224d6af8f3f377be5833e251af5351961eb4 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 26 Dec 2023 18:40:17 +0000 Subject: [PATCH] fix: correction in logic --- packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts b/packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts index ef3820ba76..645dc1db9e 100644 --- a/packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts +++ b/packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts @@ -875,9 +875,9 @@ async function _formulaQueryBuilder( // if operator is == or !=, then handle comparison with BLANK which should accept NULL and empty string if (pt.operator === '==' || pt.operator === '!=') { - if (pt.left.callee?.name !== pt.left.callee?.name) { + if (pt.left.callee?.name !== pt.right.callee?.name) { // if left/right is BLANK, accept both NULL and empty string - ['left', 'right'].forEach((operand) => { + for(const operand of ['left', 'right']){ if ( pt[operand].type === 'CallExpression' && pt[operand].callee.name === 'BLANK' @@ -895,7 +895,7 @@ async function _formulaQueryBuilder( prevBinaryOp, ); } - }); + } } }