@opengis/fastify-table 1.3.0 → 1.3.2

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.3.0",
3
+ "version": "1.3.2",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -3,11 +3,11 @@ import getPG from './getPG.js';
3
3
  const data = {};
4
4
 
5
5
  // decorator
6
- export default async function getMeta(opt) {
6
+ export default async function getMeta(opt, nocache) {
7
7
  const pg = opt?.pg || getPG({ name: 'client' });
8
8
  const table = opt?.table || opt;
9
9
 
10
- if (data[pg.options.database]?.[table]) return data[pg.options.database][table];
10
+ if (data[pg.options.database]?.[table] && !nocache) return data[pg.options.database][table];
11
11
 
12
12
  if (!pg.tlist?.includes(table?.replace?.(/"/g, ''))) {
13
13
  return { error: `${table} - not found`, status: 400 };
@@ -300,7 +300,7 @@ export default async function dataAPI(req, reply, called) {
300
300
  rows,
301
301
  meta,
302
302
  columns,
303
- filters,
303
+ filters: filters?.map?.(el => ({ ...el, sql: undefined })),
304
304
  };
305
305
 
306
306
  // console.log({ add: loadTable.table, form: loadTable.form });
@@ -129,7 +129,7 @@ export default async function filterAPI(req) {
129
129
 
130
130
  return {
131
131
  time: Date.now() - time,
132
- list: filters,
132
+ list: filters?.map?.(el => ({ ...el, sql: undefined })),
133
133
  custom: loadTable?.filterCustom,
134
134
  inline: loadTable?.filterInline,
135
135
  state: loadTable?.filterState,