feat(admin): Deleting org from orgs list now works, will permanently delete dashboards, data sources, etc, closes #2457
This commit is contained in:
@@ -113,6 +113,7 @@ func Register(r *macaron.Macaron) {
|
||||
r.Group("/orgs/:orgId", func() {
|
||||
r.Get("/", wrap(GetOrgById))
|
||||
r.Put("/", bind(m.UpdateOrgCommand{}), wrap(UpdateOrg))
|
||||
r.Delete("/", wrap(DeleteOrgById))
|
||||
r.Get("/users", wrap(GetOrgUsers))
|
||||
r.Post("/users", bind(m.AddOrgUserCommand{}), wrap(AddOrgUser))
|
||||
r.Patch("/users/:userId", bind(m.UpdateOrgUserCommand{}), wrap(UpdateOrgUser))
|
||||
|
||||
@@ -77,6 +77,14 @@ func updateOrgHelper(cmd m.UpdateOrgCommand) Response {
|
||||
return ApiSuccess("Organization updated")
|
||||
}
|
||||
|
||||
// GET /api/orgs/:orgId
|
||||
func DeleteOrgById(c *middleware.Context) Response {
|
||||
if err := bus.Dispatch(&m.DeleteOrgCommand{Id: c.ParamsInt64(":orgId")}); err != nil {
|
||||
return ApiError(500, "Failed to update organization", err)
|
||||
}
|
||||
return ApiSuccess("Organization deleted")
|
||||
}
|
||||
|
||||
func SearchOrgs(c *middleware.Context) Response {
|
||||
query := m.SearchOrgsQuery{
|
||||
Query: c.Query("query"),
|
||||
|
||||
Reference in New Issue
Block a user