@opengis/fastify-table 1.1.98 → 1.1.99
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
|
@@ -12,7 +12,7 @@ export default async function filterAPI(req) {
|
|
|
12
12
|
const loadTable = await getTemplate('table', params.table);
|
|
13
13
|
if (!loadTable) { return { status: 404, message: 'not found' }; }
|
|
14
14
|
|
|
15
|
-
const sqlTable = loadTable.sql?.filter?.((el) => !el?.disabled && el?.sql?.replace).map((el, i) => ` left join lateral (${el.sql.replace('{{uid}}', req.user
|
|
15
|
+
const sqlTable = loadTable.sql?.filter?.((el) => !el?.disabled && el?.sql?.replace).map((el, i) => ` left join lateral (${el.sql.replace('{{uid}}', req.user?.uid)}) ${el.name || `t${i}`} on 1=1 `)?.join('') || '';
|
|
16
16
|
const { fields: columns } = await pg.query(`select * from ${loadTable.table} t ${sqlTable} limit 0`);
|
|
17
17
|
|
|
18
18
|
const {
|