@faststore/api 1.12.12 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/api",
3
- "version": "1.12.12",
3
+ "version": "1.12.14",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -46,5 +46,5 @@
46
46
  "peerDependencies": {
47
47
  "graphql": "^15.6.0"
48
48
  },
49
- "gitHead": "9ef2cae11e8ae9458675d0fbfdcabe0eac0c8860"
49
+ "gitHead": "4480e494ab3aa840f1283273c53f3b55cc608fc0"
50
50
  }
@@ -205,8 +205,17 @@ const getOrderForm = async (
205
205
  id,
206
206
  });
207
207
 
208
+ // Stores that are not yet providing the session while validating the cart
209
+ // should not be able to update the shipping data
210
+ //
211
+ // This was causing errors while validating regionalizated carts
212
+ // because the following code was trying to change the shippingData to an undefined address/session
213
+ if(!session) {
214
+ return orderForm
215
+ }
216
+
208
217
  const shouldUpdateShippingData =
209
- orderForm.shippingData?.address?.postalCode != session?.postalCode;
218
+ orderForm.shippingData?.address?.postalCode != session.postalCode;
210
219
 
211
220
  if (shouldUpdateShippingData) {
212
221
  return commerce.checkout.shippingData({