Chore: Remove result field from alert commands and queries (#62714)
* remove result field from alert notification commands and queries * fix a few more tests * ok, linter * remove alert result fields * fix api calls * et tu, linter
This commit is contained in:
@@ -31,13 +31,14 @@ func newRuleReader(sqlStore AlertStore) *defaultRuleReader {
|
||||
func (arr *defaultRuleReader) fetch(ctx context.Context) []*Rule {
|
||||
cmd := &models.GetAllAlertsQuery{}
|
||||
|
||||
if err := arr.sqlStore.GetAllAlertQueryHandler(ctx, cmd); err != nil {
|
||||
alerts, err := arr.sqlStore.GetAllAlertQueryHandler(ctx, cmd)
|
||||
if err != nil {
|
||||
arr.log.Error("Could not load alerts", "error", err)
|
||||
return []*Rule{}
|
||||
}
|
||||
|
||||
res := make([]*Rule, 0)
|
||||
for _, ruleDef := range cmd.Result {
|
||||
for _, ruleDef := range alerts {
|
||||
if model, err := NewRuleFromDBAlert(ctx, arr.sqlStore, ruleDef, false); err != nil {
|
||||
arr.log.Error("Could not build alert model for rule", "ruleId", ruleDef.Id, "error", err)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user