From e080c3bcbf133df8c5ba5509044f089eaf3d8755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Fri, 18 Feb 2022 18:23:27 +0000 Subject: [PATCH] fix: filter out soft deleted individual discounts --- lib/loyalty.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/loyalty.js b/lib/loyalty.js index 9c9a8ce5..d4f9480d 100644 --- a/lib/loyalty.js +++ b/lib/loyalty.js @@ -38,7 +38,7 @@ function getAvailableIndividualDiscounts () { } function getCustomerIndividualDiscounts (customerId) { - const sql = `SELECT * FROM individual_discounts WHERE customer_id=$1 LIMIT 1` + const sql = `SELECT * FROM individual_discounts WHERE customer_id=$1 AND soft_deleted=false LIMIT 1` return db.oneOrNone(sql, [customerId]).then(res => { if (!_.isNil(res)) { return {