From da29b52e137cd79eab1e4b5ad12ddbcaae34796e Mon Sep 17 00:00:00 2001 From: Vik Date: Mon, 1 May 2023 20:05:39 +0530 Subject: [PATCH] allow null value comparision only with is --- .../QueryManager/QueryEditors/TooljetDatabase/operations.js | 6 +++--- .../QueryManager/QueryEditors/TooljetDatabase/util.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/operations.js b/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/operations.js index 462798c262..87fabfa900 100644 --- a/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/operations.js +++ b/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/operations.js @@ -60,7 +60,7 @@ async function listRows(queryOptions, organizationId, currentState) { return { status: 'failed', statusText: 'failed', - message: 'Null value comparison not allowed with equal/not equal operator, Please use IS operator instead.', + message: 'Null value comparison not allowed, To check null values Please use IS operator instead.', description: 'Is operator should be used with null value comparision.', data: {}, }; @@ -105,7 +105,7 @@ async function updateRows(queryOptions, organizationId, currentState) { return { status: 'failed', statusText: 'failed', - message: 'Null value comparison not allowed with equal/not equal operator, Please use IS operator instead.', + message: 'Null value comparison not allowed, To check null values Please use IS operator instead.', description: 'Is operator should be used with null value comparision.', data: {}, }; @@ -131,7 +131,7 @@ async function deleteRows(queryOptions, organizationId, currentState) { return { status: 'failed', statusText: 'failed', - message: 'Null value comparison not allowed with equal/not equal operator, Please use IS operator instead.', + message: 'Null value comparison not allowed, To check null values Please use IS operator instead.', description: 'Is operator should be used with null value comparision.', data: {}, }; diff --git a/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/util.js b/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/util.js index 7ef6e5b58a..d67aa2d53c 100644 --- a/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/util.js +++ b/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/util.js @@ -27,7 +27,7 @@ export const hasEqualWithNull = (queryOptions, operation) => { const filterKeys = Object.keys(filters); for (let i = 0; i < filterKeys.length; i++) { const filter = filters[filterKeys[i]]; - if ((filter.operator === 'eq' || filter.operator === 'neq') && filter.value === null) { + if (filter.operator !== 'is' && filter.value === null) { return true; } }