summaryrefslogtreecommitdiffstats
path: root/server/lib/log.js
diff options
context:
space:
mode:
authorUdo Walter2019-03-15 17:41:13 +0100
committerUdo Walter2019-03-15 17:41:13 +0100
commit8d1e3f99946d06588d9aca682c1ce85ce4b32e16 (patch)
tree73b735c783731a78afd2d82fbe83fe2121c0b666 /server/lib/log.js
parent[server/registration] Add log to the first registration. (diff)
downloadbas-8d1e3f99946d06588d9aca682c1ce85ce4b32e16.tar.gz
bas-8d1e3f99946d06588d9aca682c1ce85ce4b32e16.tar.xz
bas-8d1e3f99946d06588d9aca682c1ce85ce4b32e16.zip
[server/log] sql JSON to TEXT for mariadb compatibility
Diffstat (limited to 'server/lib/log.js')
-rw-r--r--server/lib/log.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/log.js b/server/lib/log.js
index 1f214c5..3b5dcd3 100644
--- a/server/lib/log.js
+++ b/server/lib/log.js
@@ -11,11 +11,11 @@ async function log ({ category, description, groupId, clientId, userId }) {
clientId,
userId
})
- if (groupId) entry.groupSnapshot = await db.group.findOne({ where: { id: groupId } })
- if (clientId) entry.clientSnapshot = await db.client.findOne({ where: { id: clientId } })
- if (userId) entry.userSnapshot = await db.user.findOne({ where: { id: userId } })
+ if (groupId) entry.groupSnapshot = JSON.stringify(await db.group.findOne({ where: { id: groupId }}))
+ if (clientId) entry.clientSnapshot = JSON.stringify(await db.client.findOne({ where: { id: clientId }}))
+ if (userId) entry.userSnapshot = JSON.stringify(await db.user.findOne({ where: { id: userId }}))
await entry.save()
return entry
}
-module.exports = log
+module.exports = log \ No newline at end of file