mirror of
https://github.com/Karaka-Management/oms-Auditor.git
synced 2026-02-18 14:38:40 +00:00
only log updates if model is changed
This commit is contained in:
parent
5f6839cb03
commit
bd1874acb7
|
|
@ -106,6 +106,11 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
$oldString = StringUtils::stringify($old, \JSON_PRETTY_PRINT);
|
$oldString = StringUtils::stringify($old, \JSON_PRETTY_PRINT);
|
||||||
$newString = StringUtils::stringify($new, \JSON_PRETTY_PRINT);
|
$newString = StringUtils::stringify($new, \JSON_PRETTY_PRINT);
|
||||||
|
|
||||||
|
if ($oldString === $newString) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$audit = new Audit(new NullAccount($account), $oldString, $newString, $type, $subtype, $module, $ref, $content, \ip2long($ip ?? '127.0.0.1'));
|
$audit = new Audit(new NullAccount($account), $oldString, $newString, $type, $subtype, $module, $ref, $content, \ip2long($ip ?? '127.0.0.1'));
|
||||||
|
|
||||||
AuditMapper::create($audit);
|
AuditMapper::create($audit);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user