@opengis/fastify-table 1.1.84 → 1.1.86

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.1.84",
3
+ "version": "1.1.86",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "main": "index.js",
@@ -9,9 +9,9 @@ export default async function getSelectVal({ pg = pgClients.client, name, values
9
9
  const cls = await getSelect(name);
10
10
 
11
11
  // === array ===
12
- if (cls.arr) {
12
+ if (cls?.arr && Array.isArray(cls?.arr)) {
13
13
  // console.log(name, cls?.arr, values);
14
- return cls?.arr.filter(el => values.includes(el.id.toString())).reduce((p, el) => ({ ...p, [el.id.toString()]: el.color ? el : el.text }), {});
14
+ return cls.arr.filter(el => values.includes(el.id.toString())).reduce((p, el) => ({ ...p, [el.id.toString()]: el.color ? el : el.text }), {});
15
15
  }
16
16
 
17
17
  // === sql ===
@@ -109,7 +109,7 @@ export default async function dataAPI(req) {
109
109
 
110
110
  const { rows } = await pg.query(q, (hookData?.id || params.id ? [hookData?.id || params.id] : null) || (query.key && loadTable.key ? [query.key] : []));
111
111
 
112
- const filterWhere = [fData.q, search, bbox, queryPolyline].filter((el) => el);
112
+ const filterWhere = [fData.q, search, bbox, queryPolyline, interfaceQuery].filter((el) => el);
113
113
 
114
114
  const qCount = `select
115
115
  count(*)::int as total,