mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
provisioning: simplify db query
the GetProvisionedDashboardQuery wasent used for anything else than check if a dashboard is provisioned or not. So we simplified this query to make it more maintainable.
This commit is contained in:
@@ -18,7 +18,7 @@ type DashboardExtras struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
func GetProvisionedDataByDashboardId(cmd *models.GetProvisionedDashboardByDashboardId) error {
|
||||
func GetProvisionedDataByDashboardId(cmd *models.IsDashboardProvisionedQuery) error {
|
||||
result := &models.DashboardProvisioning{}
|
||||
|
||||
exist, err := x.Where("dashboard_id = ?", cmd.DashboardId).Get(result)
|
||||
@@ -26,11 +26,7 @@ func GetProvisionedDataByDashboardId(cmd *models.GetProvisionedDashboardByDashbo
|
||||
return err
|
||||
}
|
||||
|
||||
if !exist {
|
||||
return models.ErrDashboardProvisioningDoesNotExist
|
||||
}
|
||||
|
||||
cmd.Result = result
|
||||
cmd.Result = exist
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user