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:
bergquist
2018-04-10 12:30:37 +02:00
parent 0f9b592428
commit 949484b949
8 changed files with 41 additions and 53 deletions
+3 -3
View File
@@ -102,13 +102,13 @@ func GetDashboard(c *m.ReqContext) Response {
meta.FolderUrl = query.Result.GetUrl()
}
dpQuery := &m.GetProvisionedDashboardByDashboardId{DashboardId: dash.Id}
err = bus.Dispatch(dpQuery)
isDashboardProvisioned := &m.IsDashboardProvisionedQuery{DashboardId: dash.Id}
err = bus.Dispatch(isDashboardProvisioned)
if err != nil {
return Error(500, "Error while checking if dashboard is provisioned", err)
}
if dpQuery.Result != nil {
if isDashboardProvisioned.Result {
meta.CanEdit = true
meta.Provisioned = true
}