Synchronize web and API behavior when deleting projects
This addresses #591 (closed)
Currently, the projects web controller does some things that the API does not when deleting a project:
- Deletes the repository from disk
- Deletes the wiki from disk
- Destroys the satellite
- Executes system hooks
This change makes both the API and web controllers do the same thing by modifying the API to call Projects::DestroyService
. I also implemented @sag47 's suggestion to add an optional request parameter, :keep_repo
, that allows a project to be deleted from the database without deleting the repo, wiki, or satellite. System hooks are still executed when this parameter is true.
I did not modify the web UI to use the :keep_repo
parameter, but if there is interest I can do so with a checkbox next to the 'Remove project' button.