Chore: Remove Result field from datasources (#63048)

* Remove Result field from AddDataSourceCommand
* Remove DatasourcesPermissionFilterQuery Result
* Remove GetDataSourceQuery Result
* Remove GetDataSourcesByTypeQuery Result
* Remove GetDataSourcesQuery Result
* Remove GetDefaultDataSourceQuery Result
* Remove UpdateDataSourceCommand Result
This commit is contained in:
suntala
2023-02-09 15:49:44 +01:00
committed by GitHub
parent 8048a66e90
commit 49b3027049
47 changed files with 371 additions and 369 deletions

View File

@@ -121,11 +121,11 @@ func (srv ConfigSrv) externalAlertmanagers(ctx context.Context, orgID int64) ([]
OrgID: orgID,
Type: datasources.DS_ALERTMANAGER,
}
err := srv.datasourceService.GetDataSourcesByType(ctx, query)
dataSources, err := srv.datasourceService.GetDataSourcesByType(ctx, query)
if err != nil {
return nil, fmt.Errorf("failed to fetch datasources for org: %w", err)
}
for _, ds := range query.Result {
for _, ds := range dataSources {
if ds.JsonData.Get(apimodels.HandleGrafanaManagedAlerts).MustBool(false) {
// we don't need to build the exact URL as we only need
// to know if any is set