fix: filter out soft deleted individual discounts
This commit is contained in:
parent
ead4c848ad
commit
e080c3bcbf
1 changed files with 1 additions and 1 deletions
|
|
@ -38,7 +38,7 @@ function getAvailableIndividualDiscounts () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCustomerIndividualDiscounts (customerId) {
|
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 => {
|
return db.oneOrNone(sql, [customerId]).then(res => {
|
||||||
if (!_.isNil(res)) {
|
if (!_.isNil(res)) {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue