@faststore/api 1.12.36 → 1.12.37

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
@@ -957,6 +957,13 @@ function getPropertyId(item) {
957
957
  return md5(`${item.name}:${JSON.stringify(item.value)}:${item.valueReference}`);
958
958
  }
959
959
 
960
+ const mutateChannelContext = (ctx, channelString) => {
961
+ ctx.storage.channel = ChannelMarshal.parse(channelString);
962
+ };
963
+ const mutateLocaleContext = (ctx, locale) => {
964
+ ctx.storage.locale = locale;
965
+ };
966
+
960
967
  const isAttachment = value => value.valueReference === VALUE_REFERENCES.attachment;
961
968
 
962
969
  const getId = item => {
@@ -1173,7 +1180,18 @@ const validateCart = async (_, {
1173
1180
  loaders: {
1174
1181
  skuLoader
1175
1182
  }
1176
- } = ctx; // Step1: Get OrderForm from VTEX Commerce
1183
+ } = ctx;
1184
+ const channel = session == null ? void 0 : session.channel;
1185
+ const locale = session == null ? void 0 : session.locale;
1186
+
1187
+ if (channel) {
1188
+ mutateChannelContext(ctx, channel);
1189
+ }
1190
+
1191
+ if (locale) {
1192
+ mutateLocaleContext(ctx, locale);
1193
+ } // Step1: Get OrderForm from VTEX Commerce
1194
+
1177
1195
 
1178
1196
  const orderForm = await getOrderForm(orderNumber, session, ctx); // Step1.5: Check if another system changed the orderForm with this orderNumber
1179
1197
  // If so, this means the user interacted with this cart elsewhere and expects
@@ -1646,13 +1664,6 @@ const StorePropertyValue = {
1646
1664
  }) => valueReference
1647
1665
  };
1648
1666
 
1649
- const mutateChannelContext = (ctx, channelString) => {
1650
- ctx.storage.channel = ChannelMarshal.parse(channelString);
1651
- };
1652
- const mutateLocaleContext = (ctx, locale) => {
1653
- ctx.storage.locale = locale;
1654
- };
1655
-
1656
1667
  const SORT_MAP = {
1657
1668
  price_desc: 'price:desc',
1658
1669
  price_asc: 'price:asc',