From ab033e4ee14c6b1520e9303cd207cb170939bde2 Mon Sep 17 00:00:00 2001 From: Usama Momany Date: Thu, 25 Mar 2021 12:58:43 +0200 Subject: [PATCH] Update api.go --- api.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api.go b/api.go index 274d724..0f4081f 100644 --- a/api.go +++ b/api.go @@ -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 }