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/snippetsto contain the actions we need to support (create/update/destroy) - The logic from
create_snippets_service.rbis now inapp/services/snippets/create_service.rb - The logic from
update_snippets_service.rbis 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
ServiceResponseobject - Direct usages of
snippet.destroyare now replaced bySnippets::DestroyService#executecalls - In case the user has the ability to destroy the snippet but the
.destroycall 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 🤖
