Skip to content

Commit

Permalink
refactor: change get list api
Browse files Browse the repository at this point in the history
  • Loading branch information
710leo committed Jun 6, 2024
1 parent 8fad705 commit 6f007de
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion center/router/router_alert_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (rt *Router) alertRuleGetsByGids(c *gin.Context) {
ginx.Dangerous(err)

if len(gids) == 0 {
ginx.Bomb(http.StatusForbidden, "forbidden")
ginx.NewRender(c).Data([]int{}, nil)
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion center/router/router_alert_subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (rt *Router) alertSubscribeGetsByGids(c *gin.Context) {
ginx.Dangerous(err)

if len(gids) == 0 {
ginx.Bomb(http.StatusForbidden, "forbidden")
ginx.NewRender(c).Data([]int{}, nil)
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion center/router/router_board.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (rt *Router) boardGetsByGids(c *gin.Context) {
ginx.Dangerous(err)

if len(gids) == 0 {
ginx.Bomb(http.StatusForbidden, "forbidden")
ginx.NewRender(c).Data([]int{}, nil)
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion center/router/router_mute.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (rt *Router) alertMuteGetsByGids(c *gin.Context) {
ginx.Dangerous(err)

if len(gids) == 0 {
ginx.Bomb(http.StatusForbidden, "forbidden")
ginx.NewRender(c).Data([]int{}, nil)
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion center/router/router_recording_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (rt *Router) recordingRuleGetsByGids(c *gin.Context) {
ginx.Dangerous(err)

if len(gids) == 0 {
ginx.Bomb(http.StatusForbidden, "forbidden")
ginx.NewRender(c).Data([]int{}, nil)
return
}
}
Expand Down
3 changes: 1 addition & 2 deletions center/router/router_task.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package router

import (
"net/http"
"time"

"github.com/ccfos/nightingale/v6/alert/sender"
Expand Down Expand Up @@ -53,7 +52,7 @@ func (rt *Router) taskGetsByGids(c *gin.Context) {
ginx.Dangerous(err)

if len(gids) == 0 {
ginx.Bomb(http.StatusForbidden, "forbidden")
ginx.NewRender(c).Data([]int{}, nil)
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion center/router/router_task_tpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (rt *Router) taskTplGetsByGids(c *gin.Context) {
ginx.Dangerous(err)

if len(gids) == 0 {
ginx.Bomb(http.StatusForbidden, "forbidden")
ginx.NewRender(c).Data([]int{}, nil)
return
}
}
Expand Down

0 comments on commit 6f007de

Please sign in to comment.