feat(alerting): restored alert history

This commit is contained in:
Torkel Ödegaard
2016-09-13 16:13:41 +02:00
parent b0c7e61ef8
commit 3af891d023
3 changed files with 8 additions and 7 deletions

View File

@@ -53,8 +53,10 @@ func (r *SqlAnnotationRepo) Find(query *annotations.ItemQuery) ([]*annotations.I
params = append(params, query.PanelId)
}
sql.WriteString(` AND epoch BETWEEN ? AND ?`)
params = append(params, query.From, query.To)
if query.From > 0 && query.To > 0 {
sql.WriteString(` AND epoch BETWEEN ? AND ?`)
params = append(params, query.From, query.To)
}
if query.Type != "" {
sql.WriteString(` AND type = ?`)