diff --git a/app/modules/loyalty/static/store/js/loyalty-terminal.js b/app/modules/loyalty/static/store/js/loyalty-terminal.js index cc648680..8ea4ed16 100644 --- a/app/modules/loyalty/static/store/js/loyalty-terminal.js +++ b/app/modules/loyalty/static/store/js/loyalty-terminal.js @@ -225,7 +225,7 @@ function storeLoyaltyTerminal() { loyaltyTerminalLog.info('Adding stamp...'); await apiClient.post('/store/loyalty/stamp', { - card_id: this.selectedCard.id, + card_id: this.selectedCard.card_id, staff_pin: this.pinDigits }); @@ -237,7 +237,7 @@ function storeLoyaltyTerminal() { loyaltyTerminalLog.info('Redeeming stamps...'); await apiClient.post('/store/loyalty/stamp/redeem', { - card_id: this.selectedCard.id, + card_id: this.selectedCard.card_id, staff_pin: this.pinDigits }); @@ -249,7 +249,7 @@ function storeLoyaltyTerminal() { loyaltyTerminalLog.info('Earning points...', { amount: this.earnAmount }); const response = await apiClient.post('/store/loyalty/points/earn', { - card_id: this.selectedCard.id, + card_id: this.selectedCard.card_id, purchase_amount_cents: Math.round(this.earnAmount * 100), staff_pin: this.pinDigits }); @@ -268,7 +268,7 @@ function storeLoyaltyTerminal() { loyaltyTerminalLog.info('Redeeming reward...', { reward: reward.name }); await apiClient.post('/store/loyalty/points/redeem', { - card_id: this.selectedCard.id, + card_id: this.selectedCard.card_id, reward_id: this.selectedReward, staff_pin: this.pinDigits }); @@ -281,7 +281,7 @@ function storeLoyaltyTerminal() { // Refresh card data async refreshCard() { try { - const response = await apiClient.get(`/store/loyalty/cards/${this.selectedCard.id}`); + const response = await apiClient.get(`/store/loyalty/cards/${this.selectedCard.card_id}`); if (response) { this.selectedCard = response; }