diff --git a/mylogger.js b/mylogger.js index d8ccfa7..9cb7155 100644 --- a/mylogger.js +++ b/mylogger.js @@ -533,6 +533,7 @@ module.exports = class MyLogger { ); try { + const reasonField = row[tableInfo.reasonField] ?? null; if (isDelete) { [[deleteRow]] = await logInfo.fetchStmt.execute([ modelName, modelId, originFk @@ -544,7 +545,7 @@ module.exports = class MyLogger { oldInstance, modelValue, summaryId, - row[tableInfo.reasonField] ?? null, + reasonField, deleteRow.id ]); } @@ -562,7 +563,7 @@ module.exports = class MyLogger { modelId, modelValue, summaryId, - row[tableInfo.reasonField] ?? null + reasonField ]); }