@webbio/strapi-plugin-page-builder 0.4.1-platform → 0.4.2-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webbio/strapi-plugin-page-builder",
3
- "version": "0.4.1-platform",
3
+ "version": "0.4.2-platform",
4
4
  "description": "This is the description of the plugin.",
5
5
  "scripts": {
6
6
  "develop": "tsc -p tsconfig.server.json -w",
@@ -20,6 +20,7 @@
20
20
  "url": "https://github.com/webbio/strapi-plugin-page-builder.git"
21
21
  },
22
22
  "dependencies": {
23
+ "@mantine/hooks": "^7.2.2",
23
24
  "@strapi/design-system": "^1.11.0",
24
25
  "@strapi/helper-plugin": "^4.15.0",
25
26
  "@strapi/icons": "^1.11.0",
@@ -5,14 +5,14 @@ export default {
5
5
  return await (strapi as Strapi).service('plugin::page-builder.platform').findAll();
6
6
  },
7
7
 
8
- async findOneByUid(ctx: any) {
9
- const uid = ctx?.params?.uid;
8
+ async findOneById(ctx: any) {
9
+ const id = ctx?.params?.id;
10
10
 
11
- if (!uid) {
12
- return ctx.badRequest('uid is missing.');
11
+ if (!id) {
12
+ return ctx.badRequest('id is missing.');
13
13
  }
14
14
 
15
- return await strapi.service('plugin::page-builder.platform').findOneByUid(uid);
15
+ return await strapi.service('plugin::page-builder.platform').findOneById(id);
16
16
  },
17
17
  async findPageTypesByPlatform(ctx: any) {
18
18
  const platform = ctx?.params?.platform;
@@ -69,8 +69,8 @@ const routes = {
69
69
  },
70
70
  {
71
71
  method: 'GET',
72
- path: '/platform/:uid',
73
- handler: 'platform.findOneByUid'
72
+ path: '/platform/:id',
73
+ handler: 'platform.findOneById'
74
74
  },
75
75
  {
76
76
  method: 'GET',
@@ -1,28 +1,22 @@
1
- import { Common } from '@strapi/strapi';
2
1
  import { PLATFORM_UID } from '../../shared/utils/constants';
3
2
 
4
3
  export default {
5
4
  async findAll() {
6
5
  return await strapi.entityService.findMany(PLATFORM_UID, { populate: '*' });
7
6
  },
8
- async findOneByUid(uid: Common.UID.ContentType) {
9
- return await strapi.entityService.findMany(PLATFORM_UID, {
10
- populate: '*',
11
- filters: {
12
- pagetype: {
13
- uid
14
- }
15
- }
7
+ async findOneById(id: string) {
8
+ return await strapi.entityService.findOne(PLATFORM_UID, id, {
9
+ populate: '*'
16
10
  });
17
11
  },
18
- async findPageTypesByPlatform(platform: string) {
12
+ async findPageTypesByPlatform(id: string) {
19
13
  const results = await strapi.entityService.findMany(PLATFORM_UID, {
20
14
  populate: {
21
15
  pagetype: true
22
16
  },
23
17
  filters: {
24
- title: {
25
- $eq: platform
18
+ id: {
19
+ $eq: id
26
20
  }
27
21
  }
28
22
  });