From 8d1e3f99946d06588d9aca682c1ce85ce4b32e16 Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Fri, 15 Mar 2019 16:41:13 +0000 Subject: [server/log] sql JSON to TEXT for mariadb compatibility --- server/lib/log.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/lib/log.js') 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 -- cgit v1.2.3-55-g7522