diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-21 06:10:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-21 06:10:16 +0300 |
commit | f2eb66fef8aa8cebea25bc9e671a1f146514682f (patch) | |
tree | ef3f5ad9803bb211acdfd9f0f013c987f43d8e97 /app/services/wiki_pages | |
parent | c7a46b04196859929e8e4c04fbcbf8490f228edf (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/wiki_pages')
-rw-r--r-- | app/services/wiki_pages/destroy_service.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/services/wiki_pages/destroy_service.rb b/app/services/wiki_pages/destroy_service.rb index ab5abe1c82b..1d566f98760 100644 --- a/app/services/wiki_pages/destroy_service.rb +++ b/app/services/wiki_pages/destroy_service.rb @@ -3,11 +3,14 @@ module WikiPages class DestroyService < WikiPages::BaseService def execute(page) - if page&.delete + if page.delete execute_hooks(page) + ServiceResponse.success(payload: { page: page }) + else + ServiceResponse.error( + message: _('Could not delete wiki page'), payload: { page: page } + ) end - - page end def usage_counter_action |