From 3327c4dc6fb904290176155c104d54c0ef0f3efa Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 15 Dec 2021 16:32:04 +0000 Subject: [PATCH] fix issue with 0 evaluating to false in query builder --- packages/server/src/api/controllers/row/internalSearch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/internalSearch.js b/packages/server/src/api/controllers/row/internalSearch.js index 793454e601..d8ae77156a 100644 --- a/packages/server/src/api/controllers/row/internalSearch.js +++ b/packages/server/src/api/controllers/row/internalSearch.js @@ -191,7 +191,8 @@ class QueryBuilder { } if (this.query.equal) { build(this.query.equal, (key, value) => { - if (!value) { + // 0 evaluates to false, which means we would return all rows if we don't check it + if (!value && value !== 0) { return null } return `${key}:${builder.preprocess(value, allPreProcessingOpts)}`