@lancom/shared 0.0.196 → 0.0.198

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.
@@ -55,6 +55,9 @@ export default {
55
55
  removeCanonicalProduct(id) {
56
56
  return _delete(`admin/canonical-product/${id}`);
57
57
  },
58
+ getCanonicalProductProducts(id) {
59
+ return _get(`admin/canonical-product/${id}/products`);
60
+ },
58
61
  fetchShops() {
59
62
  return _get('admin/shops');
60
63
  },
@@ -112,6 +115,9 @@ export default {
112
115
  markSubOrderAsDispatched(order, subOrder) {
113
116
  return _post(`admin/shop/${order.shop}/order/${order._id}/sub-order/${subOrder._id}/dispatched`, subOrder);
114
117
  },
118
+ generateDuplicateOrderCode(order) {
119
+ return _get(`admin/order/${order}/duplicate-code`);
120
+ },
115
121
  sendShipmentTracking(order, shipment, tracking) {
116
122
  return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/tracking/${tracking._id}/send`, tracking);
117
123
  },
@@ -311,6 +317,9 @@ export default {
311
317
  removeQuote(id) {
312
318
  return _delete(`admin/quotes/${id}`);
313
319
  },
320
+ generateDuplicateQuoteCode(quote) {
321
+ return _get(`admin/quoteq/${quote}/duplicate-code`);
322
+ },
314
323
  async fetchProductBrands() {
315
324
  return sortByName(await _get('admin/brands'));
316
325
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.196",
3
+ "version": "0.0.198",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
package/store/index.js CHANGED
@@ -47,7 +47,8 @@ export const actions = {
47
47
  commit('setSettings', shop.settings);
48
48
  if (req.headers.cookie) {
49
49
  const { country, currency } = cookieparser.parse(req.headers.cookie);
50
- const params = { country, currency, ip: req.ip };
50
+ const headers = (req && req.headers) ? Object.assign({}, req.headers) : {};
51
+ const params = { country, currency, ip: headers['x-real-ip'] || req.ip };
51
52
  const settings = await api.fetchClientSettings(shop._id, params);
52
53
  commit('setCountry', settings.country);
53
54
  commit('setCurrency', settings.currency);