Skip to content

Commit

Permalink
BTHAB-257: Only display discount alert if discount is applied
Browse files Browse the repository at this point in the history
  • Loading branch information
olayiwola-compucorp committed Oct 18, 2023
1 parent 9c1de62 commit 4318735
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@
select: ['membership_type_id.Product_Discounts.Product_Discount_Amount'],
where: [['contact_id', '=', clientID], ['status_id.is_current_member', '=', true]]
}).then(function (results) {
if (!results || results.length < 1) {
return;
}
let discountPercentage = 0;
results.forEach((membership) => {
discountPercentage += membership['membership_type_id.Product_Discounts.Product_Discount_Amount'];
Expand Down

0 comments on commit 4318735

Please sign in to comment.