@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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.12.15](https://github.com/vtex/faststore/compare/v1.12.14...v1.12.15) (2022-10-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @faststore/api
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.12.14](https://github.com/vtex/faststore/compare/v1.12.13...v1.12.14) (2022-10-13)
|
|
7
15
|
|
|
8
16
|
|
|
@@ -638,6 +638,11 @@ const StoreCollection = {
|
|
|
638
638
|
key: 'brand',
|
|
639
639
|
value: slug
|
|
640
640
|
}]
|
|
641
|
+
} : isCollection(root) ? {
|
|
642
|
+
selectedFacets: [{
|
|
643
|
+
key: 'productclusterids',
|
|
644
|
+
value: root.id
|
|
645
|
+
}]
|
|
641
646
|
} : {
|
|
642
647
|
selectedFacets: slug.split('/').map((segment, index) => ({
|
|
643
648
|
key: `category-${index + 1}`,
|
|
@@ -661,10 +666,16 @@ const StoreCollection = {
|
|
|
661
666
|
|
|
662
667
|
const segments = slug.split('/').filter(segment => Boolean(segment));
|
|
663
668
|
const slugs = segments.map((__, index) => segments.slice(0, index + 1).join('/'));
|
|
664
|
-
const collections = await Promise.all(slugs.map(s =>
|
|
669
|
+
const collections = await Promise.all(slugs.map(async s => {
|
|
670
|
+
const collection = await collectionLoader.load(s);
|
|
671
|
+
return {
|
|
672
|
+
slug: s,
|
|
673
|
+
...collection
|
|
674
|
+
};
|
|
675
|
+
}));
|
|
665
676
|
return {
|
|
666
677
|
itemListElement: collections.map((collection, index) => ({
|
|
667
|
-
item: new URL(`https://${collection.url}`).pathname.toLowerCase(),
|
|
678
|
+
item: isCollection(collection) ? `/${collection.slug}` : new URL(`https://${collection.url}`).pathname.toLowerCase(),
|
|
668
679
|
name: collection.name,
|
|
669
680
|
position: index + 1
|
|
670
681
|
})),
|