@darkpos/pricing 1.0.48 → 1.0.49

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.
@@ -14,7 +14,7 @@ module.exports = ({ actions, settings, _ }) => {
14
14
  const updatedQuantity = reset
15
15
  ? quantity
16
16
  : parseInt(`${item.quantity}${quantity}`, 10);
17
- const { updatedOrder } = actions.updateItem({
17
+ return actions.updateItem({
18
18
  order,
19
19
  itemIndex,
20
20
  item: {
@@ -22,16 +22,18 @@ module.exports = ({ actions, settings, _ }) => {
22
22
  quantity: updatedQuantity,
23
23
  },
24
24
  });
25
- return updatedOrder;
26
25
  }
27
26
  if (isBefore) {
28
- return actions.addItem({
27
+ const result = actions.addItem({
29
28
  order,
30
29
  item: { isPending: true },
31
30
  cache,
32
31
  overridenQuantity: quantity,
33
32
  });
33
+
34
+ if (result && result.updatedOrder) return result.updatedOrder;
34
35
  }
36
+
35
37
  return order;
36
38
  };
37
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darkpos/pricing",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
4
4
  "description": "Pricing calculator",
5
5
  "author": "Dark POS",
6
6
  "license": "ISC",
@@ -40,5 +40,5 @@
40
40
  "supertest": "^6.2.3",
41
41
  "supervisor": "^0.12.0"
42
42
  },
43
- "gitHead": "4706909fded1e1083441ae48c8dc154cd569a48b"
43
+ "gitHead": "7f4c199f3f67a3d9d3c2d4b01fe4f04c7113f5ad"
44
44
  }