@opengis/fastify-table 1.4.78 → 1.4.80

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.4.78",
3
+ "version": "1.4.80",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -30,7 +30,7 @@ export default async function filterAPI(req, reply, iscalled) {
30
30
  const { fields: columns = [] } = await pg.query(`select * from ${table} t ${sqlTable} limit 0`);
31
31
  const { fields = [] } = await pg.query(`select * from ${table} t limit 0`);
32
32
 
33
- const optimizedSQL = `select * from ${table} t ${sqlTable} where ${tableQuery || '1=1'}`.replace(/{{uid}}/g, user?.uid);
33
+ const optimizedSQL = `select * from ${table} t ${sqlTable} where ${tableQuery || '1=1'} and ${iscalled && query.filter ? query.filter : '1=1'}`.replace(/{{uid}}/g, user?.uid);
34
34
 
35
35
  if (query?.sql && user?.user_type === 'admin') return optimizedSQL;
36
36
 
@@ -309,6 +309,8 @@ export default async function dataAPI(req, reply, called) {
309
309
  tokens[key] = token;
310
310
  });
311
311
  }
312
+ console.log('token');
313
+ panels?.forEach?.(panel => panel?.items?.filter?.(item => item.token)?.forEach?.(el1 => Object.assign(el1, { token: tokens[el1.token] })));
312
314
 
313
315
  // conditions
314
316
  panels?.filter(el => el.items).forEach(el => {