@treely/strapi-slices 7.5.3 → 7.5.4

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.
@@ -503,12 +503,10 @@ var getPortfolioProjects = /*#__PURE__*/function () {
503
503
  params = {
504
504
  pLevel: '6',
505
505
  locale: locale,
506
- 'pagination[pageSize]': STRAPI_DEFAULT_PAGE_SIZE
506
+ 'pagination[pageSize]': STRAPI_DEFAULT_PAGE_SIZE,
507
+ status: preview ? 'draft' : 'published'
507
508
  };
508
- if (preview) {
509
- params.publicationState = 'preview';
510
- }
511
- _context.next = 7;
509
+ _context.next = 6;
512
510
  return Promise.all([fpmClient.get('/public/projects', {
513
511
  cache: cache
514
512
  }), strapiClient.get('/projects', {
@@ -520,7 +518,7 @@ var getPortfolioProjects = /*#__PURE__*/function () {
520
518
  }),
521
519
  cache: cache
522
520
  })]);
523
- case 7:
521
+ case 6:
524
522
  _yield$Promise$all = _context.sent;
525
523
  fpmProjects = _yield$Promise$all[0].data;
526
524
  strapiProjectsLocalized = _yield$Promise$all[1].data;
@@ -547,7 +545,7 @@ var getPortfolioProjects = /*#__PURE__*/function () {
547
545
  }
548
546
  return toReturn;
549
547
  }));
550
- case 14:
548
+ case 13:
551
549
  case "end":
552
550
  return _context.stop();
553
551
  }
@@ -566,13 +564,12 @@ var getStrapiCollectionType = /*#__PURE__*/function () {
566
564
  case 0:
567
565
  _ref$locale = _ref.locale, locale = _ref$locale === void 0 ? 'en' : _ref$locale, _ref$preview = _ref.preview, preview = _ref$preview === void 0 ? false : _ref$preview, _ref$filters = _ref.filters, filters = _ref$filters === void 0 ? {} : _ref$filters;
568
566
  cache = preview ? false : undefined;
569
- sharedParams = _extends({
567
+ sharedParams = {
570
568
  pLevel: '6',
571
569
  'pagination[pageSize]': STRAPI_DEFAULT_PAGE_SIZE,
572
- filters: filters
573
- }, preview ? {
574
- publicationState: 'preview'
575
- } : {});
570
+ filters: filters,
571
+ status: preview ? 'draft' : 'published'
572
+ };
576
573
  _context.next = 5;
577
574
  return strapiClient.get(path, {
578
575
  params: _extends({}, sharedParams, {
@@ -641,44 +638,42 @@ var getStrapiSingleType = /*#__PURE__*/function () {
641
638
  pLevel: '6',
642
639
  locale: locale,
643
640
  'pagination[pageSize]': STRAPI_DEFAULT_PAGE_SIZE,
644
- filters: filters
641
+ filters: filters,
642
+ status: preview ? 'draft' : 'published'
645
643
  };
646
- if (preview) {
647
- params.publicationState = 'preview';
648
- }
649
- _context.prev = 4;
650
- _context.next = 7;
644
+ _context.prev = 3;
645
+ _context.next = 6;
651
646
  return strapiClient.get(path, {
652
647
  params: params,
653
648
  cache: cache
654
649
  });
655
- case 7:
650
+ case 6:
656
651
  response = _context.sent;
657
652
  return _context.abrupt("return", response.data.data);
658
- case 11:
659
- _context.prev = 11;
660
- _context.t0 = _context["catch"](4);
653
+ case 10:
654
+ _context.prev = 10;
655
+ _context.t0 = _context["catch"](3);
661
656
  if (!(_context.t0.isAxiosError && ((_error$response = _context.t0.response) == null ? void 0 : _error$response.status) === 404)) {
662
- _context.next = 18;
657
+ _context.next = 17;
663
658
  break;
664
659
  }
665
- _context.next = 16;
660
+ _context.next = 15;
666
661
  return strapiClient.get(path, {
667
662
  params: _extends({}, params, {
668
663
  locale: STRAPI_FALLBACK_LOCALE
669
664
  }),
670
665
  cache: cache
671
666
  });
672
- case 16:
667
+ case 15:
673
668
  response = _context.sent;
674
669
  return _context.abrupt("return", response.data.data);
675
- case 18:
670
+ case 17:
676
671
  throw _context.t0;
677
- case 19:
672
+ case 18:
678
673
  case "end":
679
674
  return _context.stop();
680
675
  }
681
- }, _callee, null, [[4, 11]]);
676
+ }, _callee, null, [[3, 10]]);
682
677
  }));
683
678
  return function getStrapiSingleType(_x, _x2) {
684
679
  return _ref2.apply(this, arguments);