@faststore/api 1.12.8 → 1.12.14

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,23 @@
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.14](https://github.com/vtex/faststore/compare/v1.12.13...v1.12.14) (2022-10-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * checks for session existance before trying to update shipping data ([#1487](https://github.com/vtex/faststore/issues/1487)) ([8edced3](https://github.com/vtex/faststore/commit/8edced304ccdc804c7c9eb215955cec6f7c621ca))
12
+
13
+
14
+
15
+ ## [1.12.12](https://github.com/vtex/faststore/compare/v1.12.11...v1.12.12) (2022-10-10)
16
+
17
+ **Note:** Version bump only for package @faststore/api
18
+
19
+
20
+
21
+
22
+
6
23
  ## [1.12.8](https://github.com/vtex/faststore/compare/v1.12.7...v1.12.8) (2022-09-29)
7
24
 
8
25
  **Note:** Version bump only for package @faststore/api
@@ -1095,8 +1095,17 @@ const getOrderForm = async (id, session, {
1095
1095
 
1096
1096
  const orderForm = await commerce.checkout.orderForm({
1097
1097
  id
1098
- });
1099
- const shouldUpdateShippingData = ((_orderForm$shippingDa = orderForm.shippingData) == null ? void 0 : (_orderForm$shippingDa2 = _orderForm$shippingDa.address) == null ? void 0 : _orderForm$shippingDa2.postalCode) != (session == null ? void 0 : session.postalCode);
1098
+ }); // Stores that are not yet providing the session while validating the cart
1099
+ // should not be able to update the shipping data
1100
+ //
1101
+ // This was causing errors while validating regionalizated carts
1102
+ // because the following code was trying to change the shippingData to an undefined address/session
1103
+
1104
+ if (!session) {
1105
+ return orderForm;
1106
+ }
1107
+
1108
+ const shouldUpdateShippingData = ((_orderForm$shippingDa = orderForm.shippingData) == null ? void 0 : (_orderForm$shippingDa2 = _orderForm$shippingDa.address) == null ? void 0 : _orderForm$shippingDa2.postalCode) != session.postalCode;
1100
1109
 
1101
1110
  if (shouldUpdateShippingData) {
1102
1111
  return commerce.checkout.shippingData({
@@ -1936,7 +1945,8 @@ const StoreSearchResult = {
1936
1945
  text: searchArgs.query,
1937
1946
  misspelled: (_products$correction$ = (_products$correction = products.correction) == null ? void 0 : _products$correction.misspelled) != null ? _products$correction$ : false,
1938
1947
  match: products.recordsFiltered,
1939
- operator: products.operator
1948
+ operator: products.operator,
1949
+ locale: ctx.storage.locale
1940
1950
  }).catch(console.error);
1941
1951
  }
1942
1952