@infrab4a/connect 3.2.3 → 3.2.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/bundles/infrab4a-connect.umd.js +7 -8
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +8 -9
- package/fesm2015/infrab4a-connect.js +7 -8
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/package.json +1 -1
|
@@ -2684,19 +2684,18 @@
|
|
|
2684
2684
|
function OrderFirestoreRepository(firestore) {
|
|
2685
2685
|
var _this = _super.call(this) || this;
|
|
2686
2686
|
_this.firestore = firestore;
|
|
2687
|
-
_this.orderFromFirestore = function (order
|
|
2687
|
+
_this.orderFromFirestore = function (order) {
|
|
2688
2688
|
var _a;
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
var shopPrice = lineItem['price'][modifiedOrder.shop];
|
|
2689
|
+
if (!!((_a = order === null || order === void 0 ? void 0 : order.lineItems) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
2690
|
+
order.lineItems = order.lineItems.map(function (lineItem) {
|
|
2691
|
+
if (!!lineItem.price[order.shop]) {
|
|
2692
|
+
var shopPrice = lineItem['price'][order.shop];
|
|
2694
2693
|
lineItem['price'] = shopPrice;
|
|
2695
2694
|
}
|
|
2696
2695
|
return lineItem;
|
|
2697
2696
|
});
|
|
2698
2697
|
}
|
|
2699
|
-
return
|
|
2698
|
+
return order;
|
|
2700
2699
|
};
|
|
2701
2700
|
_this.collectionName = 'orders';
|
|
2702
2701
|
_this.model = Order;
|
|
@@ -2709,7 +2708,7 @@
|
|
|
2709
2708
|
toFirestore: function (data) { return toFirestore((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data); },
|
|
2710
2709
|
fromFirestore: function (snap) {
|
|
2711
2710
|
var instance = fromFirestore(snap);
|
|
2712
|
-
return _this.orderFromFirestore(instance
|
|
2711
|
+
return _this.orderFromFirestore(instance);
|
|
2713
2712
|
},
|
|
2714
2713
|
};
|
|
2715
2714
|
};
|