Beispiel #1
0
func (ctl *AlertController) getEditAlertsGroupAction(c *gin.Context) {

	ag, err := models.AlertGroupMapper.FetchOne(c.Param("id"))
	if err != nil {
		panic(err)
	}

	if ag == nil {
		c.Redirect(http.StatusFound, "/alerts-groups")
		return
	}

	var form models.AlertGroupUpdateForm
	form.Hydrate(ag)

	c.HTML(http.StatusOK, "alert_group_edit.html", map[string]interface{}{
		"form": form,
		"ag":   ag,
	})
}