@opengis/fastify-table 1.0.21 → 1.0.22

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/Changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # fastify-table
2
2
 
3
+ ## 1.0.22 - 03.05.2024
4
+
5
+ - getFilterSQL funcs
6
+
3
7
  ## 1.0.21 - 03.05.2024
4
8
 
5
9
  - fix widget db structure
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "main": "index.js",
@@ -42,7 +42,7 @@ async function getFilterSQL({
42
42
  filter,
43
43
  tableSQL,
44
44
  fields,
45
- filterList: filterList || (body?.filter_list || []).concat(body.filterInline || []).concat(body.filterCustom || []).concat(body.filterState || []).concat(body.filterList || []),
45
+ filterList: filterList || (body?.filter_list || []).concat(body?.filterInline || []).concat(body?.filterCustom || []).concat(body?.filterState || []).concat(body?.filterList || []),
46
46
  pg,
47
47
  config,
48
48
  });
package/table/index.js CHANGED
@@ -4,6 +4,7 @@ import search from './controllers/search.js';
4
4
  import filter from './controllers/filter.js';
5
5
  import form from './controllers/form.js';
6
6
  import metaFormat from './funcs/metaFormat/index.js';
7
+ import getFilterSQL from './funcs/getFilterSQL/index.js';
7
8
 
8
9
  const tableSchema = {
9
10
  querystring: {
@@ -27,6 +28,7 @@ const searchTableSchema = {
27
28
  async function plugin(fastify, config = {}) {
28
29
  const prefix = config.prefix || '/api';
29
30
  fastify.decorate('metaFormat', metaFormat);
31
+ fastify.decorate('getFilterSQL', getFilterSQL);
30
32
 
31
33
  fastify.get(`${prefix}/suggest/:data`, {}, suggest);
32
34
  fastify.get(`${prefix}/data/:table/:id?`, { schema: tableSchema }, data); // vs.crm.data.api с node