API: return resource ID when deleting datasource with UID and library element (#41342)

* API: return resource ID when deleting datasource and library element

* keep status codes consistent

* fix element ID

* add test

* improve response struct

* update endpoints documentation

* LibraryElementIDResponse -> DeleteLibraryElementResponse
This commit is contained in:
Agnès Toulet
2021-11-05 15:06:14 +01:00
committed by GitHub
parent e0ad74a815
commit 3a6b8535b1
7 changed files with 34 additions and 8 deletions
+4 -1
View File
@@ -160,7 +160,10 @@ func (hs *HTTPServer) DeleteDataSourceByUID(c *models.ReqContext) response.Respo
hs.Live.HandleDatasourceDelete(c.OrgId, ds.Uid)
return response.Success("Data source deleted")
return response.JSON(200, util.DynMap{
"message": "Data source deleted",
"id": ds.Id,
})
}
func (hs *HTTPServer) DeleteDataSourceByName(c *models.ReqContext) response.Response {