Skip to content
Snippets Groups Projects
Commit ce321b9f authored by Francé Wilke's avatar Francé Wilke
Browse files

Merge branch 'audit-logger-bugfixes' into 'main'

Fix bug with audit logger

See merge request uafrica/go-utils!27
parents 83358e58 32a49438
No related branches found
No related tags found
1 merge request!27Fix bug with audit logger
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment