@opengis/fastify-table 1.4.17 → 1.4.18
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/index.js
CHANGED
|
@@ -113,9 +113,9 @@ async function plugin(fastify, opt) {
|
|
|
113
113
|
templatesRoutes(fastify, opt);
|
|
114
114
|
|
|
115
115
|
// from fastify-file
|
|
116
|
+
await fastify.register(import('@fastify/multipart')); // content parser, await before adding upload routes
|
|
116
117
|
fastify.register(import('./server/routes/file/index.mjs'), opt);
|
|
117
118
|
fastify.register(import('./server/routes/grpc/index.mjs'), opt);
|
|
118
|
-
await fastify.register(import('@fastify/multipart')); // file upload
|
|
119
119
|
|
|
120
120
|
fastify.get('/api/test-proxy', {}, (req) => ({ ...req.headers || {}, sessionId: req.session?.sessionId }));
|
|
121
121
|
fastify.get('/api/config', { config: { policy: ['admin', 'site'] } }, () => config);
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ function formatSchema(schema, user, opt) {
|
|
|
15
15
|
});
|
|
16
16
|
Object.assign(obj.add, { token, api: `${config.prefix || '/api'}/table/${token}` });
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
else if (obj?.type === 'DataTable' && obj.colModel?.length) {
|
|
19
19
|
obj.colModel.forEach(parseDataTables);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -34,7 +34,7 @@ export default async function getTemplateApi(req) {
|
|
|
34
34
|
|
|
35
35
|
const data = await getTemplate(type, hookData?.name || tokenData.form || name);
|
|
36
36
|
|
|
37
|
-
if (tokenData.obj) {
|
|
37
|
+
if (data && tokenData.obj) {
|
|
38
38
|
const obj = tokenData.obj.split('#').reduce((p, el) => ({ ...p, [el.split('=')[0]]: el.split('=')[1] }), {});
|
|
39
39
|
Object.assign(data, { obj });
|
|
40
40
|
}
|
|
@@ -47,5 +47,5 @@ export default async function getTemplateApi(req) {
|
|
|
47
47
|
await applyHook('afterTemplate', {
|
|
48
48
|
name, type, data, user,
|
|
49
49
|
});
|
|
50
|
-
return data?.html || data || `template not found "${name}"`;
|
|
50
|
+
return data?.html || data || `template not found "${tokenData.form || name}"`;
|
|
51
51
|
}
|