summaryrefslogtreecommitdiff
path: root/lib/api/error_tracking.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-05 18:09:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-05 18:09:06 +0000
commitb042382bbf5a4977c5b5c6b0a9a33f4e8ca8d16d (patch)
treede31671ab7c6ca8c2a3721cbabd1f2a42b3d0194 /lib/api/error_tracking.rb
parenteabf8fd774fef6a54903e5141138f47bdafeb331 (diff)
downloadgitlab-ce-b042382bbf5a4977c5b5c6b0a9a33f4e8ca8d16d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/error_tracking.rb')
-rw-r--r--lib/api/error_tracking.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/api/error_tracking.rb b/lib/api/error_tracking.rb
index f92f1326daa..14888037f53 100644
--- a/lib/api/error_tracking.rb
+++ b/lib/api/error_tracking.rb
@@ -23,6 +23,34 @@ module API
present setting, with: Entities::ErrorTracking::ProjectSetting
end
+
+ desc 'Enable or disable error tracking settings for the project' do
+ detail 'This feature was introduced in GitLab 12.8.'
+ success Entities::ErrorTracking::ProjectSetting
+ end
+ params do
+ requires :active, type: Boolean, desc: 'Specifying whether to enable or disable error tracking settings', allow_blank: false
+ end
+
+ patch ':id/error_tracking/settings/' do
+ authorize! :admin_operations, user_project
+
+ setting = user_project.error_tracking_setting
+
+ not_found!('Error Tracking Setting') unless setting
+
+ update_params = {
+ error_tracking_setting_attributes: { enabled: params[:active] }
+ }
+
+ result = ::Projects::Operations::UpdateService.new(user_project, current_user, update_params).execute
+
+ if result[:status] == :success
+ present setting, with: Entities::ErrorTracking::ProjectSetting
+ else
+ result
+ end
+ end
end
end
end