@opengis/fastify-table 1.3.24 → 1.3.26
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.3.
|
|
3
|
+
"version": "1.3.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "core-plugins",
|
|
6
6
|
"keywords": [
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
24
24
|
"test": "node --test",
|
|
25
25
|
"test:helpers": "node --test .\\test\\helpers",
|
|
26
|
+
"test:routes": "node --test .\\test\\routes",
|
|
27
|
+
"test:functions": "node --test .\\test\\functions",
|
|
26
28
|
"docs:dev": "vitepress dev docs",
|
|
27
29
|
"docs:build": "vitepress build docs",
|
|
28
30
|
"docs:preview": "vitepress preview docs",
|
|
@@ -50,7 +50,7 @@ export default async function dataInsert({
|
|
|
50
50
|
|
|
51
51
|
returning *`;
|
|
52
52
|
|
|
53
|
-
const res = await pg.query(insertQuery, [...filterData.map((el) => (typeof el[1] === 'object'
|
|
53
|
+
const res = await pg.query(insertQuery, [...filterData.map((el) => (typeof el[1] === 'object' ? JSON.stringify(el[1]) : el[1]))]).catch(err => {
|
|
54
54
|
logger.file('crud/insert', { error: err.toString(), stack: err.stack, table, id, referer, uid, data, q: insertQuery });
|
|
55
55
|
throw new Error(err.toString());
|
|
56
56
|
}) || {};
|
|
@@ -51,7 +51,7 @@ export default async function dataUpdate({
|
|
|
51
51
|
Object.assign(data, { [el]: data[el].split(',') });
|
|
52
52
|
}
|
|
53
53
|
return [el, data[el]];
|
|
54
|
-
}).map((el) => (typeof el[1] === 'object' && el[1]
|
|
54
|
+
}).map((el) => (typeof el[1] === 'object' && el[1] ? JSON.stringify(el[1]) : el[1]));
|
|
55
55
|
|
|
56
56
|
// update geometry with srid
|
|
57
57
|
if (!srids[table] && pg.tlist?.includes('public.geometry_columns')) {
|
|
@@ -92,7 +92,7 @@ export default async function logChanges({
|
|
|
92
92
|
entity_key: el,
|
|
93
93
|
value_old: getValue(old?.[el], table),
|
|
94
94
|
value_new: type === 'DELETE' ? null : getValue(newObj?.[el], table),
|
|
95
|
-
value_hash: createHash('md5').update(JSON.stringify(newObj?.[el])).digest('hex'),
|
|
95
|
+
value_hash: newObj?.[el] ? createHash('md5').update(JSON.stringify(newObj?.[el])).digest('hex') : null,
|
|
96
96
|
uid,
|
|
97
97
|
})).filter(el => (old?.[el.entity_key] !== el.value_hash));
|
|
98
98
|
|