Skip to content

Commit b58ddac

Browse files
authored
Fixes record change history handler when FF is off (#541)
1 parent 12ad97a commit b58ddac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/models/common/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ export async function recordHistory(modifiedField, oldDocument, newDocument, dom
7878
const diff = { oldValues: new Map(), newValues: new Map() };
7979
const documents = { oldDocument, newDocument };
8080

81-
if (!await checkHistory(domainId) || process.env.HISTORY_ACTIVATED !== 'true') {
81+
const featureFlag = await checkHistory(domainId);
82+
if (!featureFlag.result || process.env.HISTORY_ACTIVATED !== 'true') {
8283
return undefined;
8384
}
8485

@@ -101,7 +102,7 @@ export async function recordHistory(modifiedField, oldDocument, newDocument, dom
101102
updatedBy: newDocument.updatedBy,
102103
date: Date.now()
103104
});
104-
105+
105106
return history.save();
106107
}
107108

0 commit comments

Comments
 (0)