dev #14494 WPA CoffeeLike изменить апи для получения последней транзакции

This commit is contained in:
nikolay 2023-06-15 15:49:33 +04:00
parent eef97fd35f
commit bef4ed1a48
3 changed files with 4 additions and 3 deletions

View File

@ -55,6 +55,7 @@ export class GuestCardComponent implements OnInit {
this.loyaltyProgram.getLastPurchase(
environment.systemId,
token || '',
this.customerInfo.id
);
},
});

View File

@ -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;

View File

@ -56,7 +56,7 @@ export class WpJsonService {
)
}
getLastPurchase(systemId: string, token: string): Observable<Purchase> {
getLastPurchase(systemId: string, token: string): Observable<any> {
return this._request(`last_trans/${systemId}/${token}/`, 'GET', null, false, environment.icardProxy);
}