@opengis/fastify-table 1.2.47 → 1.2.49
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 @@ const defaultTable = 'crm.extra_data';
|
|
|
4
4
|
|
|
5
5
|
function format(key, value, schema) {
|
|
6
6
|
if (!key || !schema?.[key]) return undefined; // skip non-existing
|
|
7
|
-
if (schema?.[key]?.type && ['Number', 'Switcher'].includes(schema?.[key]?.type)) {
|
|
7
|
+
if (schema?.[key]?.type && ['DataTable', 'Number', 'Switcher'].includes(schema?.[key]?.type)) {
|
|
8
8
|
return JSON.parse(value || null);
|
|
9
9
|
}
|
|
10
10
|
return value;
|
|
@@ -118,7 +118,7 @@ export default async function dataAPI(req, reply, called) {
|
|
|
118
118
|
${metaCols}
|
|
119
119
|
|
|
120
120
|
${dbColumns.find((el) => el.name === 'geom' && pg.pgType?.[el.dataTypeID] === 'geometry') ? ',st_asgeojson(geom)::json as geom' : ''}
|
|
121
|
-
from (select * from ${table} where ${sqlTable ? 'true' : (where.join(' and ') || 'true')}
|
|
121
|
+
from (select * from ${table} where ${sqlTable ? 'true' : (where.join(' and ') || 'true')} ) t
|
|
122
122
|
${sqlTable}
|
|
123
123
|
${params.id ? cardSqlTable : ''}
|
|
124
124
|
where ${where.join(' and ') || 'true'}
|