Skip to content

Commit 299a854

Browse files
committed
style: fix eslint issues on the server side
1 parent b6223a0 commit 299a854

File tree

8 files changed

+9
-478
lines changed

8 files changed

+9
-478
lines changed

packages/core/.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
**/config
88
**/scripts
99
**/docs
10-
**/server/types/generated
10+
**/types/generated
1111
**/__tests__
1212
strapi-admin.js
1313
strapi-server.js

packages/core/server/bootstrap.ts

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { Core } from '@strapi/strapi';
22

3-
export default async ({ strapi }: { strapi: Core.Strapi }) => {
3+
export default ({ strapi }: { strapi: Core.Strapi }) => {
44
try {
5-
// // Decorate the entity service with review workflow logic
6-
// const { decorator } = getPluginService('queryLayerDecorator');
7-
// strapi.entityService.decorate(decorator);
8-
95
// Register permission actions.
106
const actions = [
117
{
@@ -28,37 +24,8 @@ export default async ({ strapi }: { strapi: Core.Strapi }) => {
2824
},
2925
];
3026

31-
strapi.admin.services.permission.actionProvider.registerMany(actions);
32-
33-
// Give the public role permissions to access the public API endpoints.
34-
if (strapi.plugin('users-permissions')) {
35-
const roles = await strapi
36-
.service('plugin::users-permissions.role')
37-
.find();
38-
39-
const publicId = roles.filter((role) => role.type === 'public')[0]?.id;
40-
41-
if (publicId) {
42-
const publicRole = await strapi
43-
.service('plugin::users-permissions.role')
44-
.findOne(publicId);
45-
46-
publicRole.permissions['plugin::webtools'] = {
47-
controllers: {
48-
core: {
49-
router: { enabled: true },
50-
},
51-
'url-alias': {
52-
find: { enabled: true },
53-
},
54-
},
55-
};
56-
57-
await strapi
58-
.service('plugin::users-permissions.role')
59-
.updateRole(publicRole.id, publicRole);
60-
}
61-
}
27+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
28+
(strapi.admin.services.permission.actionProvider.registerMany as (a: any) => void)(actions);
6229
} catch (error) {
6330
strapi.log.error(`Bootstrap failed. ${String(error)}`);
6431
}

packages/core/server/services/__tests__/query-layer-decorator.test.js renamed to packages/core/server/middlewares/__tests__/middlewares.test.js

File renamed without changes.

packages/core/server/middlewares/generate-url-alias.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const generateUrlAliasMiddleware: Modules.Documents.Middleware.Middleware = asyn
6363
// If the document already has an URL alias, fetch it.
6464
if (params.data.url_alias?.[0]) {
6565
urlAliasEntity = await strapi.documents('plugin::webtools.url-alias').findOne({
66-
documentId: params.data.url_alias[0],
66+
documentId: params.data.url_alias[0] as string,
6767
});
6868
} else if (fullEntity.url_alias[0]) {
6969
[urlAliasEntity] = fullEntity.url_alias;

packages/core/server/routes/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default {
88
handler: 'url-alias.find',
99
config: {
1010
policies: [],
11+
auth: false,
1112
},
1213
},
1314
{
@@ -16,6 +17,7 @@ export default {
1617
handler: 'core.router',
1718
config: {
1819
policies: [],
20+
auth: false,
1921
},
2022
},
2123
],
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import urlAliasController from './url-alias';
22
import urlPatternController from './url-pattern';
33
import bulkGenerateController from './bulk-generate';
4-
import queryLayerDecorator from './query-layer-decorator';
54

65
export default {
76
'url-alias': urlAliasController,
87
'url-pattern': urlPatternController,
98
'bulk-generate': bulkGenerateController,
10-
'query-layer-decorator': queryLayerDecorator,
119
};

0 commit comments

Comments
 (0)