refs #5563 Code fix

This commit is contained in:
Juan Ferrer 2023-06-06 11:37:27 +02:00
parent 3fbf48b845
commit d2f821fcbd
2 changed files with 3 additions and 3 deletions

View File

@ -490,7 +490,7 @@ module.exports = class MyLogger {
} }
const modelId = row[tableInfo.idName]; const modelId = row[tableInfo.idName];
const modelValue = change.modelValue; const modelValue = change.modelValue ?? null;
const oldInstance = oldI ? JSON.stringify(oldI) : null; const oldInstance = oldI ? JSON.stringify(oldI) : null;
const originFk = isSecondary ? row[relation] : modelId; const originFk = isSecondary ? row[relation] : modelId;
const originChanged = isUpdate && isSecondary const originChanged = isUpdate && isSecondary
@ -522,7 +522,7 @@ module.exports = class MyLogger {
if (originFk == null) return; if (originFk == null) return;
await logInfo.addStmt.execute([ await logInfo.addStmt.execute([
originFk, originFk,
row[tableInfo.userField] || null, row[tableInfo.userField] ?? null,
action, action,
created, created,
modelName, modelName,

View File

@ -1,6 +1,6 @@
{ {
"name": "mylogger", "name": "mylogger",
"version": "0.1.23", "version": "0.1.24",
"author": "Verdnatura Levante SL", "author": "Verdnatura Levante SL",
"description": "MySQL and MariaDB logger using binary log", "description": "MySQL and MariaDB logger using binary log",
"license": "GPL-3.0", "license": "GPL-3.0",