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
This commit is contained in:
Arpit 2022-12-28 21:54:22 +05:30 committed by GitHub
parent acefdb8400
commit 6826fdc8df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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('&'));
}