@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
|
@@ -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 };
|
|
@@ -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,
|