Skip to content
Snippets Groups Projects

Fix bug with audit logger

Merged Ruaan Burger requested to merge audit-logger-bugfixes into main
1 file
+ 5
4
Compare changes
  • Side-by-side
  • Inline
+ 5
4
@@ -2,13 +2,14 @@ package audit
import (
"encoding/json"
"github.com/r3labs/diff/v2"
"gitlab.com/uafrica/go-utils/reflection"
"gitlab.com/uafrica/go-utils/string_utils"
"reflect"
"regexp"
"strconv"
"strings"
"github.com/r3labs/diff/v2"
"gitlab.com/uafrica/go-utils/reflection"
"gitlab.com/uafrica/go-utils/string_utils"
)
type FieldChange struct {
@@ -213,7 +214,7 @@ func GetAllChanges(original interface{}, new interface{}) (map[string]interface{
opener := changesJson[index+len(split)+2 : index+len(split)+3]
// Prevent a "base level" key from matching a nested key
baseLevel := false
if index >= 1 {
if index > 1 {
containedBy := changesJson[index-1 : index]
if levelsDeep == 0 && (containedBy == "{" || containedBy == "[") {
baseLevel = true
Loading