From bef4ed1a48746e6fa062f36e5fdc8bcddb052960 Mon Sep 17 00:00:00 2001 From: nikolay Date: Thu, 15 Jun 2023 15:49:33 +0400 Subject: [PATCH] =?UTF-8?q?dev=20#14494=20WPA=20CoffeeLike=20=D0=B8=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B8=D1=82=D1=8C=20=D0=B0=D0=BF=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=D0=B4=D0=BD=D0=B5?= =?UTF-8?q?=D0=B9=20=D1=82=D1=80=D0=B0=D0=BD=D0=B7=D0=B0=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default-option/pages/guest-card/guest-card.component.ts | 1 + angular/src/app/services/loyalty-program.service.ts | 4 ++-- angular/src/app/services/wp-json.service.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts b/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts index ede5375..a70a80f 100644 --- a/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts +++ b/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts @@ -55,6 +55,7 @@ export class GuestCardComponent implements OnInit { this.loyaltyProgram.getLastPurchase( environment.systemId, token || '', + this.customerInfo.id ); }, }); diff --git a/angular/src/app/services/loyalty-program.service.ts b/angular/src/app/services/loyalty-program.service.ts index 98a8263..5781650 100644 --- a/angular/src/app/services/loyalty-program.service.ts +++ b/angular/src/app/services/loyalty-program.service.ts @@ -93,11 +93,11 @@ export class LoyaltyProgramService { return lvlPeriods[this.currentLvl]; } - getLastPurchase(systemId: string, token: string) { + getLastPurchase(systemId: string, token: string, customerId: string) { this.purchaseData.$loading = true; this.wpJsonService.getLastPurchase(systemId, token).subscribe({ next: (res) => { - this.purchaseData.lastPurchase = res; + this.purchaseData.lastPurchase = res[customerId][0]; }, complete: () => { this.purchaseData.$loading = false; diff --git a/angular/src/app/services/wp-json.service.ts b/angular/src/app/services/wp-json.service.ts index 86959e8..09e2f10 100644 --- a/angular/src/app/services/wp-json.service.ts +++ b/angular/src/app/services/wp-json.service.ts @@ -56,7 +56,7 @@ export class WpJsonService { ) } - getLastPurchase(systemId: string, token: string): Observable { + getLastPurchase(systemId: string, token: string): Observable { return this._request(`last_trans/${systemId}/${token}/`, 'GET', null, false, environment.icardProxy); }