Skip to content

Commit

Permalink
fix: alert rule put
Browse files Browse the repository at this point in the history
  • Loading branch information
710leo committed Jul 30, 2021
1 parent dde431b commit 853053f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions http/router_alert_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func alertRuleAdd(c *gin.Context) {
bind(c, &f)

me := loginUser(c).MustPerm("alert_rule_create")

var ids []int64
for _, alertRule := range f {
arg := AlertRuleGroup(alertRule.GroupId)
alertRuleWritePermCheck(arg, me)
Expand All @@ -74,9 +74,10 @@ func alertRuleAdd(c *gin.Context) {
UpdateBy: me.Username,
}
dangerous(ar.Add())
ids = append(ids, ar.Id)
}

renderMessage(c, nil)
renderData(c, ids, nil)
}

func alertRulePut(c *gin.Context) {
Expand All @@ -90,6 +91,7 @@ func alertRulePut(c *gin.Context) {

ar.Name = f.Name
ar.Note = f.Note
ar.Type = f.Type
ar.Status = f.Status
ar.AlertDuration = f.AlertDuration
ar.Expression = f.Expression
Expand All @@ -111,6 +113,7 @@ func alertRulePut(c *gin.Context) {
renderMessage(c, ar.Update(
"name",
"note",
"type",
"status",
"alert_duration",
"expression",
Expand Down
2 changes: 1 addition & 1 deletion http/router_user_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func userGroupAdd(c *gin.Context) {
// 顺便把创建者也作为团队的一员,失败了也没关系,用户会重新添加成员
models.UserGroupMemberAdd(ug.Id, me.Id)

renderMessage(c, nil)
renderData(c, ug.Id, nil)
}

func userGroupPut(c *gin.Context) {
Expand Down

0 comments on commit 853053f

Please sign in to comment.