Skip to content

Commit

Permalink
v1.0.4 added AlertEnable to group
Browse files Browse the repository at this point in the history
  • Loading branch information
dgulinobw committed May 23, 2024
1 parent b2692dd commit 5fffa4b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ HOSTNAME=github.com
NAMESPACE=relaypro-open
NAME=dog_api_golang
BINARY=${NAME}
VERSION=v1.0.3
VERSION=v1.0.4
OS_ARCH=linux_amd64

default: install
Expand Down
4 changes: 1 addition & 3 deletions api/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ func decodeGroup(group Group) (groupJson GroupJson, unmarshalErr error) {
unmarshalErr = json.Unmarshal([]byte(group.Vars), &vars)
groupJson.Vars = map[string]any(vars)
}
if group.AlertEnable != nil {
groupJson.AlertEnable = group.AlertEnable
}
groupJson.AlertEnable = group.AlertEnable //add even if nil
groupJson.ID = group.ID
groupJson.Description = group.Description
groupJson.ProfileId = group.ProfileId
Expand Down
1 change: 1 addition & 0 deletions api/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func DoTestUpdateGroupEncode(t *testing.T, GroupID string) (group Group) {

assert.NotEmpty(t, res.ID, "expecting non-empty ID")
assert.Equal(t, "name_update", res.Name)
assert.Equal(t, BoolPointer(true), res.AlertEnable)
assert.Equal(t, 200, statusCode)
return res
}
Expand Down
4 changes: 1 addition & 3 deletions api/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ func decodeHost(host Host) (hostJson HostJson, unmarshalErr error) {
unmarshalErr = json.Unmarshal([]byte(host.Vars), &vars)
hostJson.Vars = map[string]any(vars)
}
//if hostJson.AlertEnable != nil {
hostJson.AlertEnable = host.AlertEnable
//}
hostJson.AlertEnable = host.AlertEnable //add even if nil
hostJson.Environment = host.Environment
hostJson.Group = host.Group
hostJson.HostKey = host.HostKey
Expand Down

0 comments on commit 5fffa4b

Please sign in to comment.