@faststore/api 1.12.14 → 1.12.16
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/CHANGELOG.md +16 -0
- package/dist/api.cjs.development.js +14 -3
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +14 -3
- package/dist/api.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/platforms/vtex/resolvers/collection.ts +16 -3
- package/src/platforms/vtex/resolvers/validateCart.ts +1 -0
package/dist/api.esm.js
CHANGED
|
@@ -634,6 +634,11 @@ const StoreCollection = {
|
|
|
634
634
|
key: 'brand',
|
|
635
635
|
value: slug
|
|
636
636
|
}]
|
|
637
|
+
} : isCollection(root) ? {
|
|
638
|
+
selectedFacets: [{
|
|
639
|
+
key: 'productclusterids',
|
|
640
|
+
value: root.id
|
|
641
|
+
}]
|
|
637
642
|
} : {
|
|
638
643
|
selectedFacets: slug.split('/').map((segment, index) => ({
|
|
639
644
|
key: `category-${index + 1}`,
|
|
@@ -657,10 +662,16 @@ const StoreCollection = {
|
|
|
657
662
|
|
|
658
663
|
const segments = slug.split('/').filter(segment => Boolean(segment));
|
|
659
664
|
const slugs = segments.map((__, index) => segments.slice(0, index + 1).join('/'));
|
|
660
|
-
const collections = await Promise.all(slugs.map(s =>
|
|
665
|
+
const collections = await Promise.all(slugs.map(async s => {
|
|
666
|
+
const collection = await collectionLoader.load(s);
|
|
667
|
+
return {
|
|
668
|
+
slug: s,
|
|
669
|
+
...collection
|
|
670
|
+
};
|
|
671
|
+
}));
|
|
661
672
|
return {
|
|
662
673
|
itemListElement: collections.map((collection, index) => ({
|
|
663
|
-
item: new URL(`https://${collection.url}`).pathname.toLowerCase(),
|
|
674
|
+
item: isCollection(collection) ? `/${collection.slug}` : new URL(`https://${collection.url}`).pathname.toLowerCase(),
|
|
664
675
|
name: collection.name,
|
|
665
676
|
position: index + 1
|
|
666
677
|
})),
|
|
@@ -1101,7 +1112,7 @@ const getOrderForm = async (id, session, {
|
|
|
1101
1112
|
return orderForm;
|
|
1102
1113
|
}
|
|
1103
1114
|
|
|
1104
|
-
const shouldUpdateShippingData = ((_orderForm$shippingDa = orderForm.shippingData) == null ? void 0 : (_orderForm$shippingDa2 = _orderForm$shippingDa.address) == null ? void 0 : _orderForm$shippingDa2.postalCode) != session.postalCode;
|
|
1115
|
+
const shouldUpdateShippingData = typeof session.postalCode === 'string' && ((_orderForm$shippingDa = orderForm.shippingData) == null ? void 0 : (_orderForm$shippingDa2 = _orderForm$shippingDa.address) == null ? void 0 : _orderForm$shippingDa2.postalCode) != session.postalCode;
|
|
1105
1116
|
|
|
1106
1117
|
if (shouldUpdateShippingData) {
|
|
1107
1118
|
return commerce.checkout.shippingData({
|