From 01a08883e808290cdcbc1d6f4b4ee3d0b4f71500 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 30 Jul 2024 13:13:30 +0200 Subject: [PATCH] feat: refs #6449 add summaryId --- config/logs.yml | 1 + mylogger.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/config/logs.yml b/config/logs.yml index 204a61b..6d35364 100644 --- a/config/logs.yml +++ b/config/logs.yml @@ -23,6 +23,7 @@ logs: - itemTag - name: item showField: name + showId: id logFields: - size exclude: diff --git a/mylogger.js b/mylogger.js index be2c508..cffc001 100644 --- a/mylogger.js +++ b/mylogger.js @@ -80,7 +80,8 @@ module.exports = class MyLogger { oldInstance = ?, newInstance = ?, changedModelId = ?, - changedModelValue = ?` + changedModelValue = ?, + summaryId = ?` ); logInfo.fetchStmt = await db.prepare( `SELECT id FROM ${sqlTable} @@ -95,7 +96,8 @@ module.exports = class MyLogger { SET originFk = ?, creationDate = ?, oldInstance = ?, - changedModelValue = ? + changedModelValue = ?, + summaryId = ? WHERE id = ?` ); } @@ -512,7 +514,7 @@ module.exports = class MyLogger { oldI = change.instance; break; } - + const summaryId = row[tableInfo.conf.showId]; const modelId = row[tableInfo.idName]; const modelValue = change.modelValue ?? null; const oldInstance = oldI ? JSON.stringify(oldI) : null; @@ -538,6 +540,7 @@ module.exports = class MyLogger { created, oldInstance, modelValue, + summaryId, deleteRow.id ]); } @@ -553,7 +556,8 @@ module.exports = class MyLogger { oldInstance, newI ? JSON.stringify(newI) : null, modelId, - modelValue + modelValue, + summaryId ]); }