@opengis/fastify-table 1.0.19 → 1.0.20

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.20 - 03.05.2024
4
+
5
+ - fix filter separator
6
+
3
7
  ## 1.0.19 - 02.05.2024
4
8
 
5
9
  - widget plugin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "main": "index.js",
@@ -24,7 +24,7 @@ export default async function data(req) {
24
24
 
25
25
  const fData = query.filter ? await getFilterSQL({
26
26
  filter: query.filter,
27
- table,
27
+ table: params.table,
28
28
  json: 1,
29
29
  }) : {};
30
30
 
@@ -42,7 +42,7 @@ async function getFilterSQL({
42
42
  filter,
43
43
  tableSQL,
44
44
  fields,
45
- filterList: body?.filter_list || 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
  });
@@ -19,7 +19,7 @@ function getQuery({
19
19
 
20
20
  const filterQueryArray = config.v3?.filter
21
21
  ? decodeURI(filterStr?.replace(/(^,)|(,$)/g, '')).replace(/'/g, '').split(/[;|]/)
22
- : decodeURI(filterStr?.replace(/(^,)|(,$)/g, '')?.replace(/,null/g, '')).replace(/'/g, '').split(/[;|,]/);
22
+ : decodeURI(filterStr?.replace(/(^,)|(,$)/g, '')?.replace(/,null/g, '')).replace(/'/g, '').split(/[;|]/);
23
23
 
24
24
  const resultList = [];
25
25
 
@@ -45,7 +45,7 @@ function getQuery({
45
45
  const type = pg.pgType?.[dataTypeID];
46
46
 
47
47
  // filter
48
- const filter = filterList?.find((el) => el.name === name) || { type: 'text' };
48
+ const filter = filterList?.find((el) => el.id === name) || { type: 'text' };
49
49
  const filterType = filter.type?.toLowerCase();
50
50
  // format query
51
51