@faststore/api 1.12.7 → 1.12.12

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 CHANGED
@@ -3,6 +3,22 @@
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.12](https://github.com/vtex/faststore/compare/v1.12.11...v1.12.12) (2022-10-10)
7
+
8
+ **Note:** Version bump only for package @faststore/api
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.12.8](https://github.com/vtex/faststore/compare/v1.12.7...v1.12.8) (2022-09-29)
15
+
16
+ **Note:** Version bump only for package @faststore/api
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.12.7](https://github.com/vtex/faststore/compare/v1.12.6...v1.12.7) (2022-09-28)
7
23
 
8
24
  **Note:** Version bump only for package @faststore/api
@@ -1691,6 +1691,18 @@ const Query = {
1691
1691
  }
1692
1692
 
1693
1693
  const sku = await skuLoader.load(skuId);
1694
+ /**
1695
+ * Here be dragons 🦄🦄🦄
1696
+ *
1697
+ * In some cases, the slug has a valid skuId for a different
1698
+ * product. This condition makes sure that the fetched sku
1699
+ * is the one we actually asked for
1700
+ * */
1701
+
1702
+ if (slug && sku.isVariantOf.linkText && !slug.startsWith(sku.isVariantOf.linkText)) {
1703
+ throw new Error(`Slug was set but the fetched sku does not satisfy the slug condition. slug: ${slug}, linkText: ${sku.isVariantOf.linkText}`);
1704
+ }
1705
+
1694
1706
  return sku;
1695
1707
  } catch (err) {
1696
1708
  if (slug == null) {
@@ -1924,7 +1936,8 @@ const StoreSearchResult = {
1924
1936
  text: searchArgs.query,
1925
1937
  misspelled: (_products$correction$ = (_products$correction = products.correction) == null ? void 0 : _products$correction.misspelled) != null ? _products$correction$ : false,
1926
1938
  match: products.recordsFiltered,
1927
- operator: products.operator
1939
+ operator: products.operator,
1940
+ locale: ctx.storage.locale
1928
1941
  }).catch(console.error);
1929
1942
  }
1930
1943