Skip to content

Commit

Permalink
Save audit logs even if no action performed in the request.
Browse files Browse the repository at this point in the history
Resolve #2820
  • Loading branch information
maliming committed Mar 3, 2020
1 parent 2e395f7 commit 5616252
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,7 @@ protected virtual async Task SaveAsync(DisposableSaveHandle saveHandle)
{
BeforeSave(saveHandle);

if (ShouldSave(saveHandle.AuditLog))
{
await _auditingStore.SaveAsync(saveHandle.AuditLog);
}
}

protected bool ShouldSave(AuditLogInfo auditLog)
{
if (!auditLog.Actions.Any() && !auditLog.EntityChanges.Any())
{
return false;
}

return true;
await _auditingStore.SaveAsync(saveHandle.AuditLog);
}

protected class DisposableSaveHandle : IAuditLogSaveHandle
Expand Down

0 comments on commit 5616252

Please sign in to comment.