@faststore/api 1.12.14 → 1.12.15
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 +8 -0
- package/dist/api.cjs.development.js +13 -2
- 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 +13 -2
- package/dist/api.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/platforms/vtex/resolvers/collection.ts +16 -3
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
|
})),
|