Chore: Remove result fields from ngalert (#65410)

* remove result fields from ngalert

* remove duplicate imports
This commit is contained in:
Serge Zaitsev
2023-03-28 10:34:35 +02:00
committed by GitHub
parent 42b58fbca6
commit 0beb768427
34 changed files with 307 additions and 317 deletions
@@ -13,8 +13,8 @@ import (
// ListAlertInstances is a handler for retrieving alert instances within specific organisation
// based on various filters.
func (st DBstore) ListAlertInstances(ctx context.Context, cmd *models.ListAlertInstancesQuery) error {
return st.SQLStore.WithDbSession(ctx, func(sess *db.Session) error {
func (st DBstore) ListAlertInstances(ctx context.Context, cmd *models.ListAlertInstancesQuery) (result []*models.AlertInstance, err error) {
err = st.SQLStore.WithDbSession(ctx, func(sess *db.Session) error {
alertInstances := make([]*models.AlertInstance, 0)
s := strings.Builder{}
@@ -37,9 +37,10 @@ func (st DBstore) ListAlertInstances(ctx context.Context, cmd *models.ListAlertI
return err
}
cmd.Result = alertInstances
result = alertInstances
return nil
})
return result, err
}
// SaveAlertInstances saves all the provided alert instances to the store.