Skip to content

Commit

Permalink
Update api.go
Browse files Browse the repository at this point in the history
  • Loading branch information
umomany committed Mar 25, 2021
1 parent e8133de commit ab033e4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions api.go
Expand Up @@ -89,9 +89,8 @@ func handleNewAlert(a *App, w http.ResponseWriter, r *http.Request) (code int, m
// a mess by not flooding with google chat webhook URLs all over the place.
roomName := r.URL.Query().Get("room_name")
if roomName == "" {
// try2
// Attempt to fetch the room name from the alert payload
roomName = alertData.Alerts[0].Labels["room_name"]
//fmt.Printf("alertData.Alerts : %+v\n", alertData.Alerts[0].Labels["room_name"])
if roomName == "" {
return http.StatusBadRequest, "Missing required room_name param", nil, excepBadRequest, err
}
Expand Down

0 comments on commit ab033e4

Please sign in to comment.