2
0
Эх сурвалжийг харах

fix deletion when no gh webhook ID is present

Mohammed Nafees 4 жил өмнө
parent
commit
6ca5c5d642

+ 7 - 3
api/server/handlers/environment/delete.go

@@ -103,9 +103,13 @@ func (c *DeleteEnvironmentHandler) ServeHTTP(w http.ResponseWriter, r *http.Requ
 
 		if err == nil {
 			for _, hook := range hooks {
-				if hook.GetURL() == webhookURL {
-					client.Repositories.DeleteHook(context.Background(), owner, name, hook.GetID())
-					break
+				if hookURL, ok := hook.Config["url"]; ok {
+					if hookURLStr, ok := hookURL.(string); ok {
+						if hookURLStr == webhookURL {
+							client.Repositories.DeleteHook(context.Background(), owner, name, hook.GetID())
+							break
+						}
+					}
 				}
 			}
 		}