@opengis/fastify-table 1.3.50 → 1.3.51
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
|
@@ -4,7 +4,7 @@ export default async function filterAPI(req) {
|
|
|
4
4
|
const time = Date.now();
|
|
5
5
|
|
|
6
6
|
const {
|
|
7
|
-
params, pg = pgClients.client, user = {},
|
|
7
|
+
params, pg = pgClients.client, user = {}, query = {},
|
|
8
8
|
} = req;
|
|
9
9
|
|
|
10
10
|
const loadTable = await getTemplate('table', params.table);
|
|
@@ -16,6 +16,8 @@ export default async function filterAPI(req) {
|
|
|
16
16
|
|
|
17
17
|
const optimizedSQL = `select * from ${loadTable.table} t ${sqlTable} where ${loadTable.query || '1=1'}`.replace(/{{uid}}/g, user?.uid);
|
|
18
18
|
|
|
19
|
+
if (query?.sql && user?.user_type === 'admin') return q;
|
|
20
|
+
|
|
19
21
|
const filters = (loadTable?.filter_list || loadTable?.filters || loadTable?.filterList || []).concat(loadTable?.filterSql || []);
|
|
20
22
|
|
|
21
23
|
// admin.custom_column - user filter NA-165
|