@faststore/api 1.12.35 → 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.cjs.development.js +19 -8
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +19 -8
- package/dist/api.esm.js.map +1 -1
- package/dist/platforms/vtex/clients/search/types/ProductSearchResult.d.ts +1 -0
- package/package.json +3 -3
- package/src/platforms/vtex/clients/search/types/ProductSearchResult.ts +1 -0
- package/src/platforms/vtex/resolvers/validateCart.ts +76 -66
- package/CHANGELOG.md +0 -1605
|
@@ -961,6 +961,13 @@ function getPropertyId(item) {
|
|
|
961
961
|
return md5(`${item.name}:${JSON.stringify(item.value)}:${item.valueReference}`);
|
|
962
962
|
}
|
|
963
963
|
|
|
964
|
+
const mutateChannelContext = (ctx, channelString) => {
|
|
965
|
+
ctx.storage.channel = ChannelMarshal.parse(channelString);
|
|
966
|
+
};
|
|
967
|
+
const mutateLocaleContext = (ctx, locale) => {
|
|
968
|
+
ctx.storage.locale = locale;
|
|
969
|
+
};
|
|
970
|
+
|
|
964
971
|
const isAttachment = value => value.valueReference === VALUE_REFERENCES.attachment;
|
|
965
972
|
|
|
966
973
|
const getId = item => {
|
|
@@ -1177,7 +1184,18 @@ const validateCart = async (_, {
|
|
|
1177
1184
|
loaders: {
|
|
1178
1185
|
skuLoader
|
|
1179
1186
|
}
|
|
1180
|
-
} = ctx;
|
|
1187
|
+
} = ctx;
|
|
1188
|
+
const channel = session == null ? void 0 : session.channel;
|
|
1189
|
+
const locale = session == null ? void 0 : session.locale;
|
|
1190
|
+
|
|
1191
|
+
if (channel) {
|
|
1192
|
+
mutateChannelContext(ctx, channel);
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
if (locale) {
|
|
1196
|
+
mutateLocaleContext(ctx, locale);
|
|
1197
|
+
} // Step1: Get OrderForm from VTEX Commerce
|
|
1198
|
+
|
|
1181
1199
|
|
|
1182
1200
|
const orderForm = await getOrderForm(orderNumber, session, ctx); // Step1.5: Check if another system changed the orderForm with this orderNumber
|
|
1183
1201
|
// If so, this means the user interacted with this cart elsewhere and expects
|
|
@@ -1650,13 +1668,6 @@ const StorePropertyValue = {
|
|
|
1650
1668
|
}) => valueReference
|
|
1651
1669
|
};
|
|
1652
1670
|
|
|
1653
|
-
const mutateChannelContext = (ctx, channelString) => {
|
|
1654
|
-
ctx.storage.channel = ChannelMarshal.parse(channelString);
|
|
1655
|
-
};
|
|
1656
|
-
const mutateLocaleContext = (ctx, locale) => {
|
|
1657
|
-
ctx.storage.locale = locale;
|
|
1658
|
-
};
|
|
1659
|
-
|
|
1660
1671
|
const SORT_MAP = {
|
|
1661
1672
|
price_desc: 'price:desc',
|
|
1662
1673
|
price_asc: 'price:asc',
|