@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.
@@ -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, id) {
2687
+ _this.orderFromFirestore = function (order) {
2688
2688
  var _a;
2689
- var modifiedOrder = _this.model.toInstance(Object.assign(Object.assign({}, order), { id: id }));
2690
- if (!!((_a = modifiedOrder === null || modifiedOrder === void 0 ? void 0 : modifiedOrder.lineItems) === null || _a === void 0 ? void 0 : _a.length)) {
2691
- modifiedOrder.lineItems = modifiedOrder.lineItems.map(function (lineItem) {
2692
- if (!!lineItem.price[modifiedOrder.shop]) {
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 modifiedOrder;
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, snap.id);
2711
+ return _this.orderFromFirestore(instance);
2713
2712
  },
2714
2713
  };
2715
2714
  };