This commit is contained in:
bergquist
2016-09-14 14:12:19 +02:00
parent d0f9623037
commit 9dd8b3b408
3 changed files with 62 additions and 35 deletions

View File

@@ -29,12 +29,16 @@ func ValidateOrgAlert(c *middleware.Context) {
func GetAlerts(c *middleware.Context) Response {
query := models.GetAlertsQuery{
OrgId: c.OrgId,
State: c.QueryStrings("state"),
DashboardId: c.QueryInt64("dashboardId"),
PanelId: c.QueryInt64("panelId"),
Limit: c.QueryInt64("limit"),
}
states := c.QueryStrings("state")
if len(states) > 0 {
query.State = states
}
if err := bus.Dispatch(&query); err != nil {
return ApiError(500, "List alerts failed", err)
}