@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.
@@ -3797,6 +3797,7 @@ var ShopCheckout = function ShopCheckout(_ref) {
3797
3797
  formatNumber = _useContext.formatNumber,
3798
3798
  locale = _useContext.locale;
3799
3799
  var _useRouter = useRouter(),
3800
+ asPath = _useRouter.asPath,
3800
3801
  push = _useRouter.push;
3801
3802
  var validateForm = useCallback(function (values) {
3802
3803
  var errors = {};
@@ -3820,6 +3821,7 @@ var ShopCheckout = function ShopCheckout(_ref) {
3820
3821
  var url = new URL(FPM_API_URI + "/v1/webhooks/shop/checkout");
3821
3822
  url.searchParams.append('batchId', slice.batchId);
3822
3823
  url.searchParams.append('quantity', Math.floor(contributionValue / slice.pricePerKg).toString());
3824
+ url.searchParams.append('cancelPath', asPath);
3823
3825
  if (slice.couponId) url.searchParams.append('couponId', slice.couponId);
3824
3826
  push(url.toString());
3825
3827
  };
@@ -4169,6 +4171,7 @@ var SmallCheckout = function SmallCheckout(_ref) {
4169
4171
  formatMessage = _useContext.formatMessage,
4170
4172
  locale = _useContext.locale;
4171
4173
  var _useRouter = useRouter(),
4174
+ asPath = _useRouter.asPath,
4172
4175
  push = _useRouter.push;
4173
4176
  var validateForm = useCallback(function (values) {
4174
4177
  var errors = {};
@@ -4189,13 +4192,17 @@ var SmallCheckout = function SmallCheckout(_ref) {
4189
4192
  }, [locale]);
4190
4193
  var onSubmit = /*#__PURE__*/function () {
4191
4194
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
4192
- var contributionValueCurrency;
4195
+ var contributionValueCurrency, url;
4193
4196
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4194
4197
  while (1) switch (_context.prev = _context.next) {
4195
4198
  case 0:
4196
4199
  contributionValueCurrency = _ref2.contributionValueCurrency;
4197
- return _context.abrupt("return", push(FPM_API_URI + "/v1/webhooks/shop/checkout?batchId=" + batchId + "&quantity=" + Math.floor(contributionValueCurrency / pricePerKg)));
4198
- case 2:
4200
+ url = new URL(FPM_API_URI + "/v1/webhooks/shop/checkout");
4201
+ url.searchParams.append('batchId', batchId);
4202
+ url.searchParams.append('quantity', Math.floor(contributionValueCurrency / pricePerKg).toString());
4203
+ url.searchParams.append('cancelPath', asPath);
4204
+ push(url.toString());
4205
+ case 6:
4199
4206
  case "end":
4200
4207
  return _context.stop();
4201
4208
  }