summaryrefslogtreecommitdiff
path: root/lib/api/wikis.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/wikis.rb')
-rw-r--r--lib/api/wikis.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/wikis.rb b/lib/api/wikis.rb
index 713136e0887..95afa36113c 100644
--- a/lib/api/wikis.rb
+++ b/lib/api/wikis.rb
@@ -61,9 +61,10 @@ module API
post ':id/wikis' do
authorize! :create_wiki, container
- page = WikiPages::CreateService.new(container: container, current_user: current_user, params: params).execute
+ response = WikiPages::CreateService.new(container: container, current_user: current_user, params: params).execute
+ page = response.payload[:page]
- if page.valid?
+ if response.success?
present page, with: Entities::WikiPage
else
render_validation_error!(page)