@opengis/fastify-table 2.0.45 → 2.0.46
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSelect.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/table/funcs/getSelect.ts"],"names":[],"mappings":"AAYA,wBAA8B,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAmB,
|
|
1
|
+
{"version":3,"file":"getSelect.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/table/funcs/getSelect.ts"],"names":[],"mappings":"AAYA,wBAA8B,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAmB,gBA6BvE"}
|
|
@@ -11,20 +11,17 @@ export default async function getSelect(name, pg = pgClients.client) {
|
|
|
11
11
|
if (loadCls[name] && !config.local)
|
|
12
12
|
return loadCls[name];
|
|
13
13
|
const clsDataGIT = await getTemplate(["cls", "select"], name);
|
|
14
|
-
const { type } =
|
|
14
|
+
const { type } = pg.pk?.["admin.user_cls"]
|
|
15
15
|
? await pg
|
|
16
16
|
.query("select type from admin.user_cls where parent is null and name=$1 union all select type from admin.cls where parent is null and name=$1 limit 1", [name])
|
|
17
17
|
.then((el) => el.rows?.[0] || {})
|
|
18
18
|
: {};
|
|
19
|
-
const
|
|
20
|
-
? sqls[type]
|
|
21
|
-
: undefined;
|
|
22
|
-
const clsDataDB = q
|
|
19
|
+
const clsDataDB = sqls[type || ""]
|
|
23
20
|
? await pg
|
|
24
|
-
.query(
|
|
21
|
+
.query(sqls[type || ""], [name])
|
|
25
22
|
.then((el) => el.rows?.find((item) => item?.data)?.data)
|
|
26
23
|
: undefined;
|
|
27
|
-
const clsData =
|
|
24
|
+
const clsData = clsDataDB ?? clsDataGIT;
|
|
28
25
|
if (!clsData)
|
|
29
26
|
return null;
|
|
30
27
|
// console.log(clsData);
|