@opengis/fastify-table 2.5.62 → 2.5.64
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/dist/helper.d.ts +1 -0
- package/dist/helper.d.ts.map +1 -1
- package/dist/server/plugins/table/funcs/getFilterSQLParametrized/getFilterList.d.ts.map +1 -1
- package/dist/server/plugins/table/funcs/getFilterSQLParametrized/getFilterList.js +4 -1
- package/dist/server/routes/table/schema.js +1 -1
- package/package.json +1 -1
package/dist/helper.d.ts
CHANGED
package/dist/helper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../helper.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,aAAa,CAAC;AAGjC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,QAAA,MAAQ,MAAM,KAAoB,CAAC;AAInC,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,GAAG
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../helper.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,aAAa,CAAC;AAGjC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,QAAA,MAAQ,MAAM,KAAoB,CAAC;AAInC,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,GAAG;;;;;;;;;;;;;;;;;;;;GAiChD;AAED,wBAAsB,KAAK,kBAI1B;AAGD,wBAAsB,QAAQ,kBAW7B;AAED,wBAAsB,KAAK,iBA+B1B;AAED,OAAO,EAEL,MAAM,EACN,MAAM,EACN,SAAS,GACV,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFilterList.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/table/funcs/getFilterSQLParametrized/getFilterList.ts"],"names":[],"mappings":"AAyBA,wBAA8B,aAAa,CACzC,EACE,KAAK,EACL,GAAG,EACH,UAAU,EACV,cAAc,EACd,YAAiB,GAClB,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;CACrC,EACD,EAAE,MAAmB,
|
|
1
|
+
{"version":3,"file":"getFilterList.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/table/funcs/getFilterSQLParametrized/getFilterList.ts"],"names":[],"mappings":"AAyBA,wBAA8B,aAAa,CACzC,EACE,KAAK,EACL,GAAG,EACH,UAAU,EACV,cAAc,EACd,YAAiB,GAClB,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;CACrC,EACD,EAAE,MAAmB,kBA8FtB"}
|
|
@@ -23,6 +23,9 @@ export default async function getFilterList({ table, uid, filterList, extraDataT
|
|
|
23
23
|
table,
|
|
24
24
|
user: { uid },
|
|
25
25
|
}, null);
|
|
26
|
+
const customClsList = await pg
|
|
27
|
+
.queryCache("select array_agg(name) from admin.user_cls where parent is null and type=$1", { table: "admin.user_cls", args: ["json"] })
|
|
28
|
+
.then((r) => r.rows?.[0]?.array_agg || []);
|
|
26
29
|
return Promise.all((filterList || [])
|
|
27
30
|
.concat(filterResponse?.inline || [])
|
|
28
31
|
.concat(filterResponse?.custom || [])
|
|
@@ -79,7 +82,7 @@ export default async function getFilterList({ table, uid, filterList, extraDataT
|
|
|
79
82
|
Object.assign(el, {
|
|
80
83
|
cls: el.data,
|
|
81
84
|
options: cls.arr,
|
|
82
|
-
select: `select code, name from admin.cls where parent='${el.data}'`,
|
|
85
|
+
select: `select code, name from ${customClsList.includes(el.data) ? "admin.user_cls" : "admin.cls"} where parent='${el.data}'`,
|
|
83
86
|
});
|
|
84
87
|
}
|
|
85
88
|
else if (typeof (cls?.sql || cls) === "string") {
|