diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-09 12:08:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-09 12:08:00 +0300 |
commit | aa10b541b6a3fbc7fa712abcc59d073fc8dc620a (patch) | |
tree | cde565fd177bcfd44ea892d6ebbdfcab4fb7cd35 /lib/api | |
parent | a5ba0dd8c6a4221f010a1fabb50aa1239314e3ef (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/api.rb | 1 | ||||
-rw-r--r-- | lib/api/pages.rb | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb index 6949cfa8e49..56eccb036b6 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -137,6 +137,7 @@ module API mount ::API::Discussions mount ::API::ResourceLabelEvents mount ::API::NotificationSettings + mount ::API::Pages mount ::API::PagesDomains mount ::API::Pipelines mount ::API::PipelineSchedules diff --git a/lib/api/pages.rb b/lib/api/pages.rb new file mode 100644 index 00000000000..e049493b10d --- /dev/null +++ b/lib/api/pages.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module API + class Pages < Grape::API + before do + require_pages_config_enabled! + authenticated_with_full_private_access! + end + + params do + requires :id, type: String, desc: 'The ID of a project' + end + resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do + desc 'Unpublish pages' do + detail 'This feature was introduced in GitLab 12.6' + end + delete ':id/pages' do + authorize! :remove_pages, user_project + + status 204 + + ::Pages::DeleteService.new(user_project, current_user).execute + end + end + end +end |