@infrab4a/connect-angular 4.17.3-beta.3 → 4.17.3-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/services/checkout.service.mjs +7 -2
- package/fesm2015/infrab4a-connect-angular.mjs +6 -1
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +6 -1
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/services/checkout.service.d.ts +5 -0
|
@@ -12,7 +12,7 @@ import { isPlatformBrowser, isPlatformServer } from '@angular/common';
|
|
|
12
12
|
import * as i1$1 from '@angular/fire/firestore';
|
|
13
13
|
import { Firestore, provideFirestore, initializeFirestore, memoryLocalCache, docSnapshots, doc } from '@angular/fire/firestore';
|
|
14
14
|
import cookie from 'js-cookie';
|
|
15
|
-
import { of, from, combineLatest, throwError, Subject, iif, forkJoin } from 'rxjs';
|
|
15
|
+
import { of, from, combineLatest, throwError, lastValueFrom, Subject, iif, forkJoin } from 'rxjs';
|
|
16
16
|
import { map, mergeMap, catchError, concatMap, tap } from 'rxjs/operators';
|
|
17
17
|
import * as i2 from '@angular/common/http';
|
|
18
18
|
import { __decorate, __metadata } from 'tslib';
|
|
@@ -1402,6 +1402,11 @@ class CheckoutService {
|
|
|
1402
1402
|
// concatMap((checkout) => this.couponService.checkCoupon(nickname, CheckoutTypes.ECOMMERCE, checkout, null).pipe()),
|
|
1403
1403
|
// )
|
|
1404
1404
|
}
|
|
1405
|
+
validateStockProducts() {
|
|
1406
|
+
return lastValueFrom(this.getCheckout().pipe(concatMap((checkout) => this.http.post(`${this.checkoutUrl}/checkoutValidateProductStock`, {
|
|
1407
|
+
checkoutId: checkout.id,
|
|
1408
|
+
}))));
|
|
1409
|
+
}
|
|
1405
1410
|
async createCheckout(checkoutData) {
|
|
1406
1411
|
const checkout = await this.checkoutRepository.create({
|
|
1407
1412
|
createdAt: new Date(),
|