feat: refs #7584 restriction noInclude

This commit is contained in:
Robert Ferrús 2024-09-09 11:43:15 +02:00
parent 5857c2294e
commit c501b254d5
1 changed files with 3 additions and 3 deletions

View File

@ -522,9 +522,9 @@ module.exports = class MyLogger {
`[${action}]`[actionColor[action]], `[${action}]`[actionColor[action]],
`${logInfo.name}: ${originFk}, ${modelName}: ${modelId}` `${logInfo.name}: ${originFk}, ${modelName}: ${modelId}`
); );
const noInclude = tableInfo.rowExcludeField && !row.editorFk;
try { try {
if (isDelete) { if (isDelete && (!tableInfo.rowExcludeField || noInclude)) {
[[deleteRow]] = await logInfo.fetchStmt.execute([ [[deleteRow]] = await logInfo.fetchStmt.execute([
modelName, modelId, originFk modelName, modelId, originFk
]); ]);
@ -540,7 +540,7 @@ module.exports = class MyLogger {
} }
if (!conf.testMode && (!isDelete || !deleteRow)) { if (!conf.testMode && (!isDelete || !deleteRow)) {
async function log(originFk) { async function log(originFk) {
if (originFk == null) return; if (originFk == null ||noInclude) return;
await logInfo.addStmt.execute([ await logInfo.addStmt.execute([
originFk, originFk,
row[tableInfo.userField] ?? null, row[tableInfo.userField] ?? null,