@treely/strapi-slices 5.7.0 → 5.8.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.
@@ -1,3 +1,3 @@
1
1
  import { PortfolioProject } from '../..';
2
- declare const getPortfolioProjects: (locale?: string) => Promise<PortfolioProject[]>;
2
+ declare const getPortfolioProjects: (locale?: string, preview?: boolean) => Promise<PortfolioProject[]>;
3
3
  export default getPortfolioProjects;
@@ -426,20 +426,30 @@ var strapiClient = /*#__PURE__*/axiosCacheInterceptor.setupCache( /*#__PURE__*/a
426
426
  }));
427
427
 
428
428
  var getPortfolioProjects = /*#__PURE__*/function () {
429
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(locale) {
430
- var _yield$Promise$all, fpmProjects, strapiProjects;
429
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(locale, preview) {
430
+ var params, _yield$Promise$all, fpmProjects, strapiProjects;
431
431
  return _regeneratorRuntime().wrap(function _callee$(_context) {
432
432
  while (1) switch (_context.prev = _context.next) {
433
433
  case 0:
434
- _context.next = 2;
434
+ if (locale === void 0) {
435
+ locale = 'en';
436
+ }
437
+ if (preview === void 0) {
438
+ preview = false;
439
+ }
440
+ params = {
441
+ populate: 'deep,6',
442
+ locale: locale,
443
+ 'pagination[pageSize]': STRAPI_DEFAULT_PAGE_SIZE
444
+ };
445
+ if (preview) {
446
+ params.publicationState = 'preview';
447
+ }
448
+ _context.next = 6;
435
449
  return Promise.all([fpmClient.get('/public/projects'), strapiClient.get('/projects', {
436
- params: {
437
- populate: 'deep,6',
438
- locale: locale,
439
- 'pagination[pageSize]': STRAPI_DEFAULT_PAGE_SIZE
440
- }
450
+ params: params
441
451
  })]);
442
- case 2:
452
+ case 6:
443
453
  _yield$Promise$all = _context.sent;
444
454
  fpmProjects = _yield$Promise$all[0].data;
445
455
  strapiProjects = _yield$Promise$all[1].data;
@@ -466,13 +476,13 @@ var getPortfolioProjects = /*#__PURE__*/function () {
466
476
  }
467
477
  return toReturn;
468
478
  }));
469
- case 6:
479
+ case 10:
470
480
  case "end":
471
481
  return _context.stop();
472
482
  }
473
483
  }, _callee);
474
484
  }));
475
- return function getPortfolioProjects(_x) {
485
+ return function getPortfolioProjects(_x, _x2) {
476
486
  return _ref.apply(this, arguments);
477
487
  };
478
488
  }();