Use internal API for deleting top level groups at the organization level
Background
Follow-up from #442810 (comment 1851575769)
The DELETE /groups/:id
doesn't work for top level groups. Because of this we link users to the group settings page to delete the group and display this in the modal:
Proposal
Similar to what we did in #444675 (closed) we could create an internal API endpoint in /app/controllers/organizations/groups_controller.rb that we can use on the frontend at the organization level.
Requirements
- Should implement logic from /app/controllers/groups_controller.rb#L175 and /ee/app/controllers/ee/groups_controller.rb#L48
- Should return a JSON response based on guidelines in https://docs.gitlab.com/ee/api/rest/#data-validation-and-error-reporting
Implementation guide
Backend
MR for reference !150707 (diffs)
Frontend
In app/assets/javascripts/organizations/shared/components/groups_view.vue#L173 change the API endpoint to the new internal one
Edited by Abdul Wadood