Dashboards: Remove dummy trim dashboard api (#77249)

Co-authored-by: nikimanoledaki <niki.manoledaki@grafana.com>
This commit is contained in:
Ryan McKinley
2023-11-02 08:35:14 -07:00
committed by GitHub
co-authored by nikimanoledaki
parent e714c9303e
commit 45d59cf31b
19 changed files with 12 additions and 208 deletions
-39
View File
@@ -68,32 +68,6 @@ func dashboardGuardianResponse(err error) response.Response {
return response.Error(http.StatusForbidden, "Access denied to this dashboard", nil)
}
// swagger:route POST /dashboards/trim dashboards trimDashboard
//
// Trim defaults from dashboard.
//
// Responses:
// 200: trimDashboardResponse
// 401: unauthorisedError
// 500: internalServerError
func (hs *HTTPServer) TrimDashboard(c *contextmodel.ReqContext) response.Response {
cmd := dashboards.TrimDashboardCommand{}
if err := web.Bind(c.Req, &cmd); err != nil {
return response.Error(http.StatusBadRequest, "bad request data", err)
}
dash := cmd.Dashboard
meta := cmd.Meta
// TODO temporarily just return the input as a no-op while we convert to thema calls
dto := dtos.TrimDashboardFullWithMeta{
Dashboard: dash,
Meta: meta,
}
c.TimeRequest(metrics.MApiDashboardGet)
return response.JSON(http.StatusOK, dto)
}
// swagger:route GET /dashboards/uid/{uid} dashboards getDashboardByUID
//
// Get dashboard by uid.
@@ -1233,13 +1207,6 @@ type CalcDashboardDiffParams struct {
}
}
// swagger:parameters trimDashboard
type TrimDashboardParams struct {
// in:body
// required:true
Body dashboards.TrimDashboardCommand
}
// swagger:response dashboardResponse
type DashboardResponse struct {
// The response message
@@ -1315,12 +1282,6 @@ type CalculateDashboardDiffResponse struct {
Body []byte `json:"body"`
}
// swagger:response trimDashboardResponse
type TrimDashboardResponse struct {
// in: body
Body dtos.TrimDashboardFullWithMeta `json:"body"`
}
// swagger:response getHomeDashboardResponse
type GetHomeDashboardResponse struct {
// in: body