@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/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 => collectionLoader.load(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
  })),