summaryrefslogtreecommitdiff
path: root/app/services/projects/prometheus/alerts/alert_params.rb
blob: 1c39ed36b122da5ef3a7044ba27fe9411c20c685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module Projects
  module Prometheus
    module Alerts
      module AlertParams
        def alert_params
          return params if params[:operator].blank?

          params.merge(
            operator: PrometheusAlert.operator_to_enum(params[:operator])
          )
        end
      end
    end
  end
end