@treely/strapi-slices 5.4.0 → 5.5.0

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.
@@ -3810,6 +3810,7 @@ var ShopCheckout = function ShopCheckout(_ref) {
3810
3810
  formatNumber = _useContext.formatNumber,
3811
3811
  locale = _useContext.locale;
3812
3812
  var _useRouter = router.useRouter(),
3813
+ asPath = _useRouter.asPath,
3813
3814
  push = _useRouter.push;
3814
3815
  var validateForm = React.useCallback(function (values) {
3815
3816
  var errors = {};
@@ -3833,6 +3834,7 @@ var ShopCheckout = function ShopCheckout(_ref) {
3833
3834
  var url = new URL(FPM_API_URI + "/v1/webhooks/shop/checkout");
3834
3835
  url.searchParams.append('batchId', slice.batchId);
3835
3836
  url.searchParams.append('quantity', Math.floor(contributionValue / slice.pricePerKg).toString());
3837
+ url.searchParams.append('cancelPath', asPath);
3836
3838
  if (slice.couponId) url.searchParams.append('couponId', slice.couponId);
3837
3839
  push(url.toString());
3838
3840
  };
@@ -4182,6 +4184,7 @@ var SmallCheckout = function SmallCheckout(_ref) {
4182
4184
  formatMessage = _useContext.formatMessage,
4183
4185
  locale = _useContext.locale;
4184
4186
  var _useRouter = router.useRouter(),
4187
+ asPath = _useRouter.asPath,
4185
4188
  push = _useRouter.push;
4186
4189
  var validateForm = React.useCallback(function (values) {
4187
4190
  var errors = {};
@@ -4202,13 +4205,17 @@ var SmallCheckout = function SmallCheckout(_ref) {
4202
4205
  }, [locale]);
4203
4206
  var onSubmit = /*#__PURE__*/function () {
4204
4207
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
4205
- var contributionValueCurrency;
4208
+ var contributionValueCurrency, url;
4206
4209
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4207
4210
  while (1) switch (_context.prev = _context.next) {
4208
4211
  case 0:
4209
4212
  contributionValueCurrency = _ref2.contributionValueCurrency;
4210
- return _context.abrupt("return", push(FPM_API_URI + "/v1/webhooks/shop/checkout?batchId=" + batchId + "&quantity=" + Math.floor(contributionValueCurrency / pricePerKg)));
4211
- case 2:
4213
+ url = new URL(FPM_API_URI + "/v1/webhooks/shop/checkout");
4214
+ url.searchParams.append('batchId', batchId);
4215
+ url.searchParams.append('quantity', Math.floor(contributionValueCurrency / pricePerKg).toString());
4216
+ url.searchParams.append('cancelPath', asPath);
4217
+ push(url.toString());
4218
+ case 6:
4212
4219
  case "end":
4213
4220
  return _context.stop();
4214
4221
  }