@webbio/strapi-plugin-page-builder 0.12.1-platform → 0.12.3-platform

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webbio/strapi-plugin-page-builder",
3
- "version": "0.12.1-platform",
3
+ "version": "0.12.3-platform",
4
4
  "description": "This is the description of the plugin.",
5
5
  "scripts": {
6
6
  "develop": "tsc -p tsconfig.server.json -w",
@@ -198,6 +198,7 @@ const afterUpdate = async (result) => {
198
198
  data: {
199
199
  ...pageData,
200
200
  id: result.collectionTypeData[0].id,
201
+ ...(result.customPublishedAt ? { publishedAt: result.customPublishedAt } : undefined),
201
202
  lifecycleState: {
202
203
  exit: true
203
204
  }
@@ -61,21 +61,24 @@ const getPageByPath = (strapi) => {
61
61
  };
62
62
  return result;
63
63
  };
64
- const results = await getPage();
65
- if (((_a = Object.values(results)) === null || _a === void 0 ? void 0 : _a.filter(Boolean).length) > 0) {
66
- if (!((_b = results === null || results === void 0 ? void 0 : results.platform) === null || _b === void 0 ? void 0 : _b.isPrivate) && !(results === null || results === void 0 ? void 0 : results.isPrivate)) {
67
- return results;
64
+ const result = await getPage();
65
+ if (((_a = Object.values(result)) === null || _a === void 0 ? void 0 : _a.filter(Boolean).length) > 0) {
66
+ if ((result === null || result === void 0 ? void 0 : result.path) === '404' || result.path === '500') {
67
+ return result;
68
68
  }
69
- if ((((_c = results === null || results === void 0 ? void 0 : results.platform) === null || _c === void 0 ? void 0 : _c.isPrivate) === true && ctx.koaContext.req.headers.authorization) ||
70
- ((results === null || results === void 0 ? void 0 : results.isPrivate) === true && ctx.koaContext.req.headers.authorization)) {
69
+ if (!((_b = result === null || result === void 0 ? void 0 : result.platform) === null || _b === void 0 ? void 0 : _b.isPrivate) && !(result === null || result === void 0 ? void 0 : result.isPrivate)) {
70
+ return result;
71
+ }
72
+ if ((((_c = result === null || result === void 0 ? void 0 : result.platform) === null || _c === void 0 ? void 0 : _c.isPrivate) === true && ctx.koaContext.req.headers.authorization) ||
73
+ ((result === null || result === void 0 ? void 0 : result.isPrivate) === true && ctx.koaContext.req.headers.authorization)) {
71
74
  const auth = ctx.koaContext.req.headers.authorization;
72
75
  const token = auth.split(' ');
73
76
  const jwtService = strapi.plugin('users-permissions').service('jwt');
74
77
  const decodedToken = await jwtService.verify(token[1]);
75
78
  if (decodedToken) {
76
79
  const user = ctx.state.user;
77
- if (((_d = user === null || user === void 0 ? void 0 : user.platform) === null || _d === void 0 ? void 0 : _d.id) === ((_e = results === null || results === void 0 ? void 0 : results.platform) === null || _e === void 0 ? void 0 : _e.id)) {
78
- return results;
80
+ if (((_d = user === null || user === void 0 ? void 0 : user.platform) === null || _d === void 0 ? void 0 : _d.id) === ((_e = result === null || result === void 0 ? void 0 : result.platform) === null || _e === void 0 ? void 0 : _e.id)) {
81
+ return result;
79
82
  }
80
83
  }
81
84
  }