Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions model.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,17 +485,21 @@ func getTargetBody() string {
}

func getIdFromTargetResponse(body io.Reader) string {
type TargetConf struct {
type TargetConfInner struct {
Type string `json:"type"`
Id string `json:"id"`
}
type TargetConf struct {
Target TargetConfInner
Enabled bool
}
var response []TargetConf
if err := json.NewDecoder(body).Decode(&response); err != nil {
fmt.Printf("Error decoding: %v\n", err)
}

target := response[0]
return target.Id
return target.Target.Id
}

func getAlertBody(stream string, targetId string) string {
Expand Down
Loading