@growy/strapi-plugin-encrypted-field 2.1.7 → 2.1.9

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.
@@ -66,7 +66,7 @@ const Input = (props) => {
66
66
 
67
67
  const logAudit = async (action, fieldName, fieldValue) => {
68
68
  try {
69
- const response = await fetch('/api/audit-logs/log', {
69
+ const response = await fetch('/encrypted-field/audit-logs/log', {
70
70
  method: 'POST',
71
71
  headers: {
72
72
  'Content-Type': 'application/json',
@@ -110,8 +110,8 @@ export default {
110
110
  defaultMessage: 'Logs de Auditoría',
111
111
  },
112
112
  Component: async () => {
113
- const { AuditLogs } = await import('./pages/AuditLogs');
114
- return AuditLogs;
113
+ const component = await import('./pages/AuditLogs');
114
+ return component.default;
115
115
  },
116
116
  permissions: [
117
117
  {
@@ -11,7 +11,7 @@ const AuditLogs = () => {
11
11
  const fetchLogs = async (page = 1) => {
12
12
  try {
13
13
  setLoading(true);
14
- const response = await fetch(`/api/audit-logs?page=${page}&pageSize=${pagination.pageSize}`);
14
+ const response = await fetch(`/encrypted-field/audit-logs?page=${page}&pageSize=${pagination.pageSize}`);
15
15
 
16
16
  if (response.ok) {
17
17
  const data = await response.json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growy/strapi-plugin-encrypted-field",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "description": "Campo personalizado de texto cifrado para Strapi",
5
5
  "strapi": {
6
6
  "name": "encrypted-field",
package/server/index.js CHANGED
@@ -1,10 +1,16 @@
1
1
  const register = require('./register');
2
2
  const bootstrap = require('./bootstrap');
3
3
  const decrypt = require('./middlewares/decrypt');
4
+ const auditLogController = require('./controllers/audit-log');
5
+ const auditLogRoutes = require('./routes/audit-log');
4
6
 
5
7
  module.exports = {
6
8
  register,
7
9
  bootstrap,
10
+ controllers: {
11
+ 'audit-log': auditLogController,
12
+ },
13
+ routes: auditLogRoutes,
8
14
  middlewares: {
9
15
  decrypt,
10
16
  },
@@ -8,7 +8,4 @@ module.exports = ({ strapi }) => {
8
8
  plugin: 'encrypted-field',
9
9
  type: 'string',
10
10
  });
11
-
12
- // Registrar rutas de auditoría
13
- strapi.server.routes(require('./routes/audit-log'));
14
11
  };
@@ -1,30 +1,20 @@
1
- module.exports = {
2
- 'log': {
3
- type: 'content-api',
4
- routes: [
5
- {
6
- method: 'POST',
7
- path: '/audit-logs/log',
8
- handler: 'audit-log.log',
9
- config: {
10
- policies: [],
11
- middlewares: []
12
- }
13
- }
14
- ]
1
+ module.exports = [
2
+ {
3
+ method: 'POST',
4
+ path: '/audit-logs/log',
5
+ handler: 'audit-log.log',
6
+ config: {
7
+ policies: [],
8
+ auth: false,
9
+ }
15
10
  },
16
- 'getLogs': {
17
- type: 'content-api',
18
- routes: [
19
- {
20
- method: 'GET',
21
- path: '/audit-logs',
22
- handler: 'audit-log.getLogs',
23
- config: {
24
- policies: [],
25
- middlewares: []
26
- }
27
- }
28
- ]
11
+ {
12
+ method: 'GET',
13
+ path: '/audit-logs',
14
+ handler: 'audit-log.getLogs',
15
+ config: {
16
+ policies: [],
17
+ auth: false,
18
+ }
29
19
  }
30
- };
20
+ ];