diff --git a/src/models/common/index.js b/src/models/common/index.js index abc3990..fe0510a 100644 --- a/src/models/common/index.js +++ b/src/models/common/index.js @@ -78,7 +78,8 @@ export async function recordHistory(modifiedField, oldDocument, newDocument, dom const diff = { oldValues: new Map(), newValues: new Map() }; const documents = { oldDocument, newDocument }; - if (!await checkHistory(domainId) || process.env.HISTORY_ACTIVATED !== 'true') { + const featureFlag = await checkHistory(domainId); + if (!featureFlag.result || process.env.HISTORY_ACTIVATED !== 'true') { return undefined; } @@ -101,7 +102,7 @@ export async function recordHistory(modifiedField, oldDocument, newDocument, dom updatedBy: newDocument.updatedBy, date: Date.now() }); - + return history.save(); }