From 1c8098fe73ea9f08007cf50cdaad89fe8c22dc7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Thu, 9 Sep 2021 18:00:18 +0100 Subject: [PATCH] fix: SQL boolean and nullable value comparison --- lib/tx.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tx.js b/lib/tx.js index 063aa45f..f42f9b61 100644 --- a/lib/tx.js +++ b/lib/tx.js @@ -74,7 +74,8 @@ function customerHistory (customerId, thresholdDays) { FROM cash_out_txs txOut WHERE txOut.customer_id = $1 AND txOut.created > now() - interval $2 - AND (timedout = true OR error_code != 'operatorCancel') + AND timedout IS false + AND error_code IS DISTINCT FROM 'operatorCancel' ORDER BY created;` const days = _.isNil(thresholdDays) ? 0 : thresholdDays