@opengis/admin 0.1.63 → 0.1.65

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/admin",
3
- "version": "0.1.63",
3
+ "version": "0.1.65",
4
4
  "description": "This project Softpro Admin",
5
5
  "main": "dist/admin.js",
6
6
  "type": "module",
@@ -1,4 +1,5 @@
1
- import { addHook, getToken, setToken, getTemplate, config } from '@opengis/fastify-table/utils.js';
1
+ import config from '../../config.js'
2
+ import { addHook, getToken, setToken, getTemplate } from '@opengis/fastify-table/utils.js';
2
3
 
3
4
  async function getTokenData({
4
5
  req, mode = 'w', token, uid,
@@ -28,8 +29,9 @@ export default async function plugin(fastify) {
28
29
 
29
30
  addHook('preTable', async ({ req, table, user = {} }) => {
30
31
  const { uid } = config?.auth?.disable ? { uid: '1' } : user || {};
31
- const opt = await getTokenData({ req, mode: 'w', token: table, uid });
32
- return opt;
32
+
33
+ //const opt = await getTokenData({ req, mode: 'w', token: table, uid });
34
+ // return opt;
33
35
  });
34
36
  addHook('preData', async ({ req, table, id, user = {} }) => {
35
37
  const { uid } = config?.auth?.disable ? { uid: '1' } : user || {};
@@ -2,10 +2,11 @@ import { applyHook, getTemplate } from "@opengis/fastify-table/utils.js";
2
2
 
3
3
  export default async function getTemplateApi(req) {
4
4
  const { user } = req?.session?.passport || {};
5
+ const { funcs, params = {}, session = {} } = req;
5
6
  const res = await applyHook('preTemplate', { req, name: params?.name, type: params?.type, user });
6
7
  if (res) return res;
7
8
 
8
- const { funcs, params = {}, session = {} } = req;
9
+
9
10
  const { type, name } = params;
10
11
 
11
12
  const data = await getTemplate(type, name);