@lancom/shared 0.0.120 → 0.0.121

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.
@@ -181,6 +181,18 @@ export default {
181
181
  removeProductType(id) {
182
182
  return _delete(`admin/product-types/${id}`);
183
183
  },
184
+ fetchSubscribes() {
185
+ return _get('admin/subscribe');
186
+ },
187
+ fetchSubscribeById(id) {
188
+ return _get(`admin/subscribe/${id}`);
189
+ },
190
+ saveSubscribe(subscribe) {
191
+ return subscribe._id ? _put(`admin/subscribe/${subscribe._id}`, subscribe) : _post('admin/subscribe', subscribe);
192
+ },
193
+ removeSubscribe(id) {
194
+ return _delete(`admin/subscribe/${id}`);
195
+ },
184
196
  fetchCoupons() {
185
197
  return _get('admin/coupons');
186
198
  },
@@ -3,7 +3,11 @@ export function convertQuoteToOrder(quote, option) {
3
3
  paymentMethod: option.paymentMethod || 'deposit',
4
4
  billingAddress: quote.address,
5
5
  shippingAddress: quote.address,
6
- products: option.products,
6
+ products: option.products.map(p => ({
7
+ ...p,
8
+ prints: p.prints.filter(print => !(option.prints || []).some(({ _id }) => print._id === _id))
9
+ })),
10
+ prints: option.prints,
7
11
  total: option.total,
8
12
  totalGST: option.totalGST,
9
13
  productsTotal: option.productsTotal,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.120",
3
+ "version": "0.0.121",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
package/store/quote.js CHANGED
@@ -38,7 +38,8 @@ export const actions = {
38
38
  const playload = {
39
39
  populatePrints: true,
40
40
  populateShop: true,
41
- populateColors: true
41
+ populateColors: true,
42
+ mergePrints: true
42
43
  };
43
44
  const quote = await api.fetchQuoteById(id, playload);
44
45
  commit('setQuote', quote);