@opengis/fastify-table 1.4.44 → 1.4.46
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
|
@@ -26,9 +26,9 @@ export default async function dataDelete({
|
|
|
26
26
|
|
|
27
27
|
const table = pg.pk[table1] ? table1 : table1.replace(/"/g, '');
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
if (!table) return 'table not exist';
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
const { pk } = await getMeta({ pg, table });
|
|
32
32
|
|
|
33
33
|
const delQuery = `delete from ${table} WHERE ${pk}::text = $1::text returning *`;
|
|
34
34
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import routeData from '../../../routes/table/controllers/tableData.js';
|
|
2
2
|
|
|
3
3
|
export default async function getData({
|
|
4
|
-
id, table, pg, headers, filter, state, limit, page, search, user, order, desc, sql, contextQuery, sufix,
|
|
4
|
+
id, table, pg, headers, filter, state, limit, page, search, user, order, desc, sql, contextQuery, sufix, filterList,
|
|
5
5
|
}, reply, called) {
|
|
6
6
|
const params = { table, id };
|
|
7
7
|
const query = {
|
|
8
8
|
filter, limit, page, search, sql, state, order, desc,
|
|
9
9
|
};
|
|
10
10
|
const result = await routeData({
|
|
11
|
-
pg, headers, params, query, user, contextQuery, sufix,
|
|
11
|
+
pg, headers, params, query, user, contextQuery, sufix, filterList,
|
|
12
12
|
}, reply, called);
|
|
13
13
|
return result;
|
|
14
14
|
}
|
|
@@ -8,7 +8,7 @@ import getData from '../functions/getData.js';
|
|
|
8
8
|
|
|
9
9
|
export default async function getTableData(req, reply, called) {
|
|
10
10
|
const {
|
|
11
|
-
user = {}, params = {}, headers = {}, query = {}, pg = pgClients.client, contextQuery: contextQuery1, sufix = true,
|
|
11
|
+
user = {}, params = {}, headers = {}, query = {}, pg = pgClients.client, contextQuery: contextQuery1, sufix = true, filterList,
|
|
12
12
|
} = req;
|
|
13
13
|
|
|
14
14
|
const { id } = params || {};
|
|
@@ -30,7 +30,7 @@ export default async function getTableData(req, reply, called) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const resp = await getData({
|
|
33
|
-
pg, params: { id, table: tokenData.table }, headers, query, user, contextQuery: [contextQuery1, tokenData.query].filter(Boolean).join(' and '), sufix,
|
|
33
|
+
pg, params: { id, table: tokenData.table }, headers, query, user, contextQuery: [contextQuery1, tokenData.query].filter(Boolean).join(' and '), sufix, filterList,
|
|
34
34
|
}, reply, called);
|
|
35
35
|
if (resp?.addToken && tokenData.obj) { Object.assign(resp, { addToken: params.table }); }
|
|
36
36
|
return resp;
|
|
@@ -52,7 +52,7 @@ export default async function getTableData(req, reply, called) {
|
|
|
52
52
|
const contextQuery = [contextQuery1, interfaceQuery, context].filter(Boolean).join(' and ') || ' 2=2 ';
|
|
53
53
|
|
|
54
54
|
const res = await getData({
|
|
55
|
-
pg, params, query, headers, user, contextQuery, sufix,
|
|
55
|
+
pg, params, query, headers, user, contextQuery, sufix, filterList,
|
|
56
56
|
}, reply, called);
|
|
57
57
|
|
|
58
58
|
return res;
|
|
@@ -33,7 +33,7 @@ const defaultLimit = 20;
|
|
|
33
33
|
|
|
34
34
|
export default async function dataAPI(req, reply, called) {
|
|
35
35
|
const {
|
|
36
|
-
pg = pgClients.client, params, headers = {}, query = {}, user = {}, contextQuery, sufix = true,
|
|
36
|
+
pg = pgClients.client, params, headers = {}, query = {}, user = {}, contextQuery, sufix = true, filterList,
|
|
37
37
|
} = req;
|
|
38
38
|
|
|
39
39
|
const time = Date.now();
|
|
@@ -170,6 +170,7 @@ export default async function dataAPI(req, reply, called) {
|
|
|
170
170
|
uid,
|
|
171
171
|
json: 1,
|
|
172
172
|
objectId,
|
|
173
|
+
filterList,
|
|
173
174
|
}) : {};
|
|
174
175
|
|
|
175
176
|
timeArr.push(Date.now());
|