diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-09-07 13:38:03 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-09-07 13:38:03 +0300 |
commit | 8ed0a051076b2486a10904575a24d9bda7306fa0 (patch) | |
tree | 224ec59caebf2c253ed23f2a5465ab755234b69c /lib/api/helpers.rb | |
parent | 1bdabb39f88d00aa1b809bf2d117e5e22384866f (diff) | |
parent | 2915bb27078a3eae0bac36bd2c3a2e1c4998130c (diff) |
Merge branch 'wiki_api' into 'master'
Add API support for wiki pages
Closes #12747
See merge request !13372
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index e646c63467a..8b03df65ae4 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -56,6 +56,12 @@ module API @project ||= find_project!(params[:id]) end + def wiki_page + page = user_project.wiki.find_page(params[:slug]) + + page || not_found!('Wiki Page') + end + def available_labels @available_labels ||= LabelsFinder.new(current_user, project_id: user_project.id).execute end |