@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/dist/{add-page-LONm322L.js → add-page-Dl_bGhPC.js} +1 -1
- package/dist/{admin-interface-eocB4uF3.js → admin-interface-Dma-D4A9.js} +1 -1
- package/dist/{admin-view-CEePX3t5.js → admin-view-TeTAUVK1.js} +1 -1
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +1 -1
- package/dist/{card-page-CnQufGpK.js → card-page-D-3aubBo.js} +1 -1
- package/dist/{card-view-MKU1ijjK.js → card-view-CZjPaUKx.js} +1 -1
- package/dist/{edit-page-C1wXXuPF.js → edit-page-RhKgRai9.js} +1 -1
- package/dist/{import-file-BkyTVz51.js → import-file-DgJqxKyF.js} +2228 -2228
- package/package.json +1 -1
- package/server/plugins/hook.js +5 -3
- package/server/routes/templates/controllers/getTemplate.js +2 -1
package/package.json
CHANGED
package/server/plugins/hook.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
import
|
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
|
-
|
32
|
-
|
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
|
-
|
9
|
+
|
9
10
|
const { type, name } = params;
|
10
11
|
|
11
12
|
const data = await getTemplate(type, name);
|