mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 13:02:33 +08:00
Added name and id in response of create/update (#7016)
This commit is contained in:

committed by
Torkel Ödegaard

parent
fa01022494
commit
13c4ce68ee
@ -158,7 +158,7 @@ parent = "http_api"
|
|||||||
HTTP/1.1 200
|
HTTP/1.1 200
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{"id":1,"message":"Datasource added"}
|
{"id":1,"message":"Datasource added", "name": "test_datasource"}
|
||||||
|
|
||||||
## Update an existing data source
|
## Update an existing data source
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ parent = "http_api"
|
|||||||
HTTP/1.1 200
|
HTTP/1.1 200
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{"message":"Datasource updated"}
|
{"message":"Datasource updated", "id": 1, "name": "test_datasource"}
|
||||||
|
|
||||||
## Delete an existing data source
|
## Delete an existing data source
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ func AddDataSource(c *middleware.Context, cmd m.AddDataSourceCommand) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(200, util.DynMap{"message": "Datasource added", "id": cmd.Result.Id})
|
c.JSON(200, util.DynMap{"message": "Datasource added", "id": cmd.Result.Id, "name": cmd.Result.Name})
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpdateDataSource(c *middleware.Context, cmd m.UpdateDataSourceCommand) Response {
|
func UpdateDataSource(c *middleware.Context, cmd m.UpdateDataSourceCommand) Response {
|
||||||
@ -117,7 +117,7 @@ func UpdateDataSource(c *middleware.Context, cmd m.UpdateDataSourceCommand) Resp
|
|||||||
return ApiError(500, "Failed to update datasource", err)
|
return ApiError(500, "Failed to update datasource", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return Json(200, util.DynMap{"message": "Datasource updated"})
|
return Json(200, util.DynMap{"message": "Datasource updated", "id": cmd.Id, "name": cmd.Name})
|
||||||
}
|
}
|
||||||
|
|
||||||
func fillWithSecureJsonData(cmd *m.UpdateDataSourceCommand) error {
|
func fillWithSecureJsonData(cmd *m.UpdateDataSourceCommand) error {
|
||||||
|
Reference in New Issue
Block a user