style(alerting): align quiet hours code and tests with Go style guide
ci / image (pull_request) Successful in 4m28s
ci / build (pull_request) Successful in 8m16s
ci / lint (pull_request) Successful in 12m11s
ci / test (pull_request) Successful in 15m40s

This commit is contained in:
Sebastian Unterschütz committed 2026-11-22 19:43:17 +01:00
1 parent ee3769f578
commit 1c31003baf
4 files changed
+162 -94

No files matched your search

+9 -3
View File
@@ -78,14 +78,20 @@ func (s *Server) saveAlertGroup(c *gin.Context) {
}
}
var quietRaw []byte
if req.QuietHours != nil {
switch {
case req.QuietHours != nil:
qh, code := validateQuietHours(req.QuietHours)
if code != "" {
fail(c, http.StatusUnprocessableEntity, code)
return
}
quietRaw, _ = json.Marshal(qh)
} else if c.Param("id") == "" {
var err error
quietRaw, err = json.Marshal(qh)
if err != nil {
internalError(c, err)
return
}
case c.Param("id") == "":
quietRaw = []byte("[]")
}
ctx := c.Request.Context()