2019-12-09 04:08:00 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
2020-10-14 20:08:42 -04:00
|
|
|
class Pages < ::API::Base
|
2020-10-30 11:08:59 -04:00
|
|
|
feature_category :pages
|
|
|
|
|
2019-12-09 04:08:00 -05:00
|
|
|
before do
|
|
|
|
require_pages_config_enabled!
|
2019-12-17 04:07:48 -05:00
|
|
|
authenticated_with_can_read_all_resources!
|
2019-12-09 04:08:00 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
params do
|
2022-11-03 11:11:31 -04:00
|
|
|
requires :id, types: [String, Integer], desc: 'The ID or URL-encoded path of the project'
|
2019-12-09 04:08:00 -05:00
|
|
|
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
|
|
|
|
|
|
|
|
::Pages::DeleteService.new(user_project, current_user).execute
|
2020-01-16 13:08:46 -05:00
|
|
|
|
|
|
|
no_content!
|
2019-12-09 04:08:00 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|