Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/projects/operations/update_service.rb')
-rw-r--r--app/services/projects/operations/update_service.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/services/projects/operations/update_service.rb b/app/services/projects/operations/update_service.rb
index dd72c2844c2..64519501ff4 100644
--- a/app/services/projects/operations/update_service.rb
+++ b/app/services/projects/operations/update_service.rb
@@ -12,7 +12,9 @@ module Projects
private
def project_update_params
- error_tracking_params.merge(metrics_setting_params)
+ error_tracking_params
+ .merge(metrics_setting_params)
+ .merge(grafana_integration_params)
end
def metrics_setting_params
@@ -44,6 +46,14 @@ module Projects
}
}
end
+
+ def grafana_integration_params
+ return {} unless attrs = params[:grafana_integration_attributes]
+
+ destroy = attrs[:grafana_url].blank? && attrs[:token].blank?
+
+ { grafana_integration_attributes: attrs.merge(_destroy: destroy) }
+ end
end
end
end