diff options
Diffstat (limited to 'app/services/projects')
-rw-r--r-- | app/services/projects/operations/update_service.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/services/projects/operations/update_service.rb b/app/services/projects/operations/update_service.rb index 3ee6c2467c2..f0144ad1213 100644 --- a/app/services/projects/operations/update_service.rb +++ b/app/services/projects/operations/update_service.rb @@ -15,6 +15,7 @@ module Projects error_tracking_params .merge(metrics_setting_params) .merge(grafana_integration_params) + .merge(prometheus_integration_params) end def metrics_setting_params @@ -77,6 +78,15 @@ module Projects { grafana_integration_attributes: attrs.merge(_destroy: destroy) } end + + def prometheus_integration_params + return {} unless attrs = params[:prometheus_integration_attributes] + + service = project.find_or_initialize_service(::PrometheusService.to_param) + service.assign_attributes(attrs) + + { prometheus_service_attributes: service.attributes.except(*%w(id project_id created_at updated_at)) } + end end end end |