Skip to content

Commit

Permalink
Fix(mongoose-audit): default audit user
Browse files Browse the repository at this point in the history
  • Loading branch information
Akalanka47000 authored Mar 10, 2024
1 parent a75e386 commit 6f038a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/mongoose-audit/src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const options = {
};

const addAuditLogObject = (currentObject, original) => {
const user = currentObject.__user || options.getUser?.() || "Unknown User";
const user = currentObject.__user || options.getUser?.() || "Unknown";
delete currentObject.__user;
let changes = deepDiff(JSON.parse(JSON.stringify(original ?? {})), JSON.parse(JSON.stringify(currentObject ?? {})), filter);
if (changes?.length) {
Expand Down

0 comments on commit 6f038a4

Please sign in to comment.