From 5d5a04c00f9ccd1e50d26c04b4c6ee9de383c935 Mon Sep 17 00:00:00 2001 From: gofnnp Date: Tue, 8 Nov 2022 13:25:29 +0400 Subject: [PATCH] =?UTF-8?q?dev=20#13014=20=D0=BF=D0=BE=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=20=D1=81=D0=BF=D0=B8=D1=81=D0=BE=D0=BA=20?= =?UTF-8?q?=D1=82=D1=80=D0=B0=D0=BD=D0=B7=D0=B0=D0=BA=D1=86=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/account/orders/orders.component.ts | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/angular/src/app/pages/account/orders/orders.component.ts b/angular/src/app/pages/account/orders/orders.component.ts index 490138b..d0a8476 100644 --- a/angular/src/app/pages/account/orders/orders.component.ts +++ b/angular/src/app/pages/account/orders/orders.component.ts @@ -42,19 +42,22 @@ export class OrdersComponent implements OnInit { this.deauthorization.emit(true) return } - const purchases = (await lastValueFrom( + const customerInfo = (await lastValueFrom( + this.wpJsonService.getCustomerInfo(environment.systemId, token, environment.icardProxy) + )) + const purchases: Purchase[] = (await lastValueFrom( this.wpJsonService.getTransactions(environment.systemId, token, environment.icardProxy, 30) - )); + ))[customerInfo.customer_info.id]; - // this.purchases = purchases.map((purchase) => { - // const id = purchase.ID.slice(0,36).toLowerCase(); - // // purchase.Transactions = transactions.filter((transaction) => { - // // const same = transaction.Purchase === id; - // // transaction.HasPurchase = same; - // // return same; - // // }); - // return purchase; - // }); + this.purchases = purchases.map((purchase) => { + // const id = purchase.ID.slice(0,36).toLowerCase(); + // purchase.Transactions = transactions.filter((transaction) => { + // const same = transaction.Purchase === id; + // transaction.HasPurchase = same; + // return same; + // }); + return purchase; + }); this.purchasesShortArray = this.purchases.slice(0, this.lastViewOrder) this.ordersLoadingStatus = false; }