Skip to content

Commit 8ee8562

Browse files
committed
fix(api): return correct json info after updating datasource
closes grafana#6869
1 parent c871212 commit 8ee8562

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func Register(r *macaron.Macaron) {
193193
r.Group("/datasources", func() {
194194
r.Get("/", GetDataSources)
195195
r.Post("/", quota("data_source"), bind(m.AddDataSourceCommand{}), AddDataSource)
196-
r.Put("/:id", bind(m.UpdateDataSourceCommand{}), UpdateDataSource)
196+
r.Put("/:id", bind(m.UpdateDataSourceCommand{}), wrap(UpdateDataSource))
197197
r.Delete("/:id", DeleteDataSource)
198198
r.Get("/:id", wrap(GetDataSourceById))
199199
r.Get("/name/:name", wrap(GetDataSourceByName))

pkg/api/datasources.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func UpdateDataSource(c *middleware.Context, cmd m.UpdateDataSourceCommand) Resp
117117
return ApiError(500, "Failed to update datasource", err)
118118
}
119119

120-
return Json(200, "Datasource updated")
120+
return Json(200, util.DynMap{"message": "Datasource updated"})
121121
}
122122

123123
func fillWithSecureJsonData(cmd *m.UpdateDataSourceCommand) error {

0 commit comments

Comments
 (0)