From 650ab5f8092725d43a48b048d7d8f072b435cfae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Oliveira?= Date: Fri, 23 Jul 2021 18:31:05 +0100 Subject: [PATCH] fix: add fiat filter inside a single AND clause --- lib/tx.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tx.js b/lib/tx.js index b35fccdd..52a39906 100644 --- a/lib/tx.js +++ b/lib/tx.js @@ -75,7 +75,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' OR fiat > 0) + AND (timedout = true OR error_code != 'operatorCancel') + AND fiat > 0 ORDER BY created;` const days = _.isNil(thresholdDays) ? 0 : thresholdDays