@opengis/admin 0.1.85 → 0.1.86
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{IconChevronDown-IrRpX-i0.js → IconChevronDown-BP50SBFz.js} +1 -1
- package/dist/{add-page-DRXx4iOi.js → add-page-DbjBxsHN.js} +1 -1
- package/dist/{admin-interface-BY-D9Jvu.js → admin-interface-CNBVM_7D.js} +2 -2
- package/dist/{admin-view-BZ75rygK.js → admin-view-CyAXWfSU.js} +2 -2
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +3 -3
- package/dist/{card-page-BAeSkHUO.js → card-page-BNs9nE8c.js} +1 -1
- package/dist/{card-view-p73B3Gbl.js → card-view-Dyopcvx4.js} +1 -1
- package/dist/{edit-page-CZ8SDvjo.js → edit-page-CtNICp9w.js} +1 -1
- package/dist/{import-file-f46xrNIz.js → import-file-CBlObEWm.js} +843 -827
- package/package.json +1 -1
- package/server/plugins/hook.js +5 -2
- package/server/routes/notifications/funcs/sendNotification.js +1 -1
- package/server/routes/properties/controllers/admin.properties.get.js +1 -1
- package/server/routes/properties/controllers/admin.properties.post.js +2 -2
- package/server/routes/templates/controllers/getTemplate.js +3 -3
package/package.json
CHANGED
package/server/plugins/hook.js
CHANGED
@@ -82,9 +82,12 @@ export default async function plugin(fastify) {
|
|
82
82
|
if (type === 'select') {
|
83
83
|
clsQuery.push(`insert into admin.cls(name,type,data,module) values('${name}','sql','${(loadTemplate?.sql || loadTemplate)?.replace(/'/g, "''")}', '${module?.replace(/'/g, "''")}')`);
|
84
84
|
} else if (type === 'cls' && loadTemplate?.length) {
|
85
|
+
if (name === 'appeal_type') {
|
86
|
+
console.log('hit');
|
87
|
+
}
|
85
88
|
clsQuery.push(`insert into admin.cls(name,type, module) values('${name}','json', '${module?.replace(/'/g, "''")}');
|
86
|
-
insert into admin.cls(code,name,parent,icon)
|
87
|
-
select value->>'id',value->>'text','${name}',value->>'icon'
|
89
|
+
insert into admin.cls(code,name,parent,icon,data)
|
90
|
+
select value->>'id',value->>'text','${name}',value->>'icon',value->>'data'
|
88
91
|
from json_array_elements('${JSON.stringify(loadTemplate).replace(/'/g, "''")}'::json)`);
|
89
92
|
} else {
|
90
93
|
console.log(name, type, 'empty');
|
@@ -70,7 +70,7 @@ export default async function notification({
|
|
70
70
|
if (provider.includes('email')) {
|
71
71
|
const files = Array.isArray(file) ? file : [file];
|
72
72
|
const attachments = files?.length && false ? await Promise.all(files?.filter((el) => el).map(async (el) => {
|
73
|
-
/* const content = await downloadFile(el, {
|
73
|
+
/* const content = await downloadFile(el, { buffer: true }); // ?
|
74
74
|
return {
|
75
75
|
filename: el.split('/').pop(),
|
76
76
|
encoding: 'base64',
|
@@ -5,7 +5,7 @@ import { config, getRedis } from '@opengis/fastify-table/utils.js';
|
|
5
5
|
import { getSettings } from '../../../../utils.js';
|
6
6
|
|
7
7
|
export default async function getSettingsAPI({
|
8
|
-
pg = {},
|
8
|
+
pg = {}, params = {}, query = {},
|
9
9
|
}) {
|
10
10
|
if (!pg.pk?.[table]) {
|
11
11
|
return { message: 'table not found', status: 404 };
|
@@ -3,7 +3,7 @@ const table = 'admin.properties';
|
|
3
3
|
import { setSettings } from '../../../../utils.js';
|
4
4
|
|
5
5
|
export default async function postSettingsAPI({
|
6
|
-
pg, session = {},
|
6
|
+
pg, session = {}, body = {},
|
7
7
|
}) {
|
8
8
|
if (session.passport?.user?.user_type !== 'superadmin') {
|
9
9
|
return { message: 'access restricted', status: 403 };
|
@@ -18,7 +18,7 @@ export default async function postSettingsAPI({
|
|
18
18
|
}
|
19
19
|
|
20
20
|
const res = await setSettings({
|
21
|
-
pg,
|
21
|
+
pg, key, val, body,
|
22
22
|
});
|
23
23
|
if (res?.error) return res;
|
24
24
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { applyHook, getTemplate, getToken } from "@opengis/fastify-table/utils.js";
|
1
|
+
import { config, applyHook, getTemplate, getToken } from "@opengis/fastify-table/utils.js";
|
2
2
|
// import { getToken } from "../../../../../fastify-table/utils.js";
|
3
3
|
|
4
4
|
export default async function getTemplateApi(req) {
|
5
5
|
const { user } = req?.session?.passport || {};
|
6
|
-
const {
|
6
|
+
const { params = {}, session = {} } = req;
|
7
7
|
const { type, name } = params;
|
8
8
|
|
9
9
|
const tokenData = await getToken({ token: name, uid: user?.uid, json: 1 }) || {};
|
@@ -16,7 +16,7 @@ export default async function getTemplateApi(req) {
|
|
16
16
|
const data = await getTemplate(type, hookData?.name || tokenData.form || name);
|
17
17
|
if (!['interface', 'table'].includes(type)
|
18
18
|
&& (!data?.public || !data?.ispublic)
|
19
|
-
&& !
|
19
|
+
&& !config?.auth?.disable
|
20
20
|
&& !session.passport?.user?.uid
|
21
21
|
&& false
|
22
22
|
) {
|