From 6826fdc8df6a2dd89ea91998ebfb10561d0d7f84 Mon Sep 17 00:00:00 2001 From: Arpit Date: Wed, 28 Dec 2022 21:54:22 +0530 Subject: [PATCH] Tooljet db query - Filter condition should resolved dynamic variables used in the editor (#5080) * fixes: filters were not resolved when a non string is passed * check for undefined and null * clean up --- .../QueryManager/QueryEditors/TooljetDatabase/operations.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/operations.js b/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/operations.js index e0a502e73e..676f5f9434 100644 --- a/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/operations.js +++ b/frontend/src/Editor/QueryManager/QueryEditors/TooljetDatabase/operations.js @@ -33,7 +33,7 @@ function buildPostgrestQuery(filters) { postgrestQueryBuilder.order(column, order); } - if (!isEmpty(column) && !isEmpty(operator) && !isEmpty(value)) { + if (!isEmpty(column) && !isEmpty(operator) && value && value !== '') { postgrestQueryBuilder[operator](column, value.toString()); } } @@ -56,7 +56,6 @@ async function listRows(queryOptions, organizationId, currentState) { !isEmpty(orderQuery) && query.push(orderQuery); !isEmpty(limit) && query.push(`limit=${limit}`); } - return await tooljetDatabaseService.findOne(organizationId, tableName, query.join('&')); }