@lancom/shared 0.0.451 → 0.0.452
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/assets/js/api/index.js
CHANGED
|
@@ -96,6 +96,9 @@ const api = {
|
|
|
96
96
|
fetchRelatedProducts(shop, alias, params) {
|
|
97
97
|
return _get(`shop/${shop}/products/${alias}/related-products`, params);
|
|
98
98
|
},
|
|
99
|
+
fetchOtherProducts(shop, alias, params) {
|
|
100
|
+
return _get(`shop/${shop}/products/${alias}/other-products`, params);
|
|
101
|
+
},
|
|
99
102
|
fetchHelpMessages(shop, group) {
|
|
100
103
|
return _get(`shop/${shop}/help-messages/${group}`);
|
|
101
104
|
},
|
|
@@ -29,9 +29,13 @@ export default {
|
|
|
29
29
|
OtherProduct
|
|
30
30
|
},
|
|
31
31
|
props: {
|
|
32
|
-
|
|
32
|
+
product: {
|
|
33
33
|
type: Object,
|
|
34
|
-
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
toEditor: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true
|
|
35
39
|
},
|
|
36
40
|
limit: {
|
|
37
41
|
type: Number,
|
|
@@ -55,13 +59,11 @@ export default {
|
|
|
55
59
|
try {
|
|
56
60
|
this.loading = true;
|
|
57
61
|
const condition = {
|
|
58
|
-
...this.additionalCondition,
|
|
59
62
|
country: this.country?._id,
|
|
60
63
|
currency: this.currency?._id,
|
|
61
64
|
limit: this.limit
|
|
62
65
|
};
|
|
63
|
-
this.products = (await api.
|
|
64
|
-
console.log('this.products: ', this.products);
|
|
66
|
+
this.products = (await api.fetchOtherProducts(this.shop._id, this.product.alias, condition)).products;
|
|
65
67
|
} catch (e) {
|
|
66
68
|
} finally {
|
|
67
69
|
this.loading = false;
|