Move snippets services to their own namespace
What does this MR do?
In this MR we have updated the existing code for snippets services so that it aligns better with the current structure:
- We introduce a new folder
app/services/snippets
to contain the actions we need to support (create/update/destroy) - The logic from
create_snippets_service.rb
is now inapp/services/snippets/create_service.rb
- The logic from
update_snippets_service.rb
is now inapp/services/snippets/update_service.rb
- We introduce
Snippets::DestroyService
(which is needed later on to handle the deletion of the snippet repository) - Usages for the old services are updated
- All the services now return a
ServiceResponse
object - Direct usages of
snippet.destroy
are now replaced bySnippets::DestroyService#execute
calls - In case the user has the ability to destroy the snippet but the
.destroy
call doesn't succeed, the snippet page loads again and shows this message:
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Ref Issue: #39083 (closed)
Edited by 🤖 GitLab Bot 🤖