mirror of
https://github.com/optim-enterprises-bv/databunker.git
synced 2025-10-31 18:07:47 +00:00
add tests
This commit is contained in:
@@ -173,18 +173,20 @@ func (dbobj dbcon) getAuditEvent(atoken string) (string, []byte, error) {
|
||||
}
|
||||
result := fmt.Sprintf(`{"before":%s,"after":%s,"debug":"%s"}`, before2, after2, debug)
|
||||
return userTOKEN, []byte(result), nil
|
||||
} else if len(after) > 0 {
|
||||
}
|
||||
if len(after) > 0 {
|
||||
after2, _ := dbobj.userDecrypt(userTOKEN, after)
|
||||
log.Printf("after: %s", after2)
|
||||
record["after"] = after2
|
||||
result := fmt.Sprintf(`{"after":%s,"debug":"%s"}`, after2, debug)
|
||||
return userTOKEN, []byte(result), nil
|
||||
}
|
||||
if len(debug) > 0 {
|
||||
result := fmt.Sprintf(`{"debug":"%s"}`, debug)
|
||||
return userTOKEN, []byte(result), nil
|
||||
}
|
||||
return userTOKEN, []byte("{}"), nil
|
||||
}
|
||||
}
|
||||
if len(debug) > 0 {
|
||||
result := fmt.Sprintf(`{"debug":"%s"}`, debug)
|
||||
return userTOKEN, []byte(result), nil
|
||||
}
|
||||
return userTOKEN, nil, nil
|
||||
return userTOKEN, nil, errors.New("not found")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user