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

update_service.rb « service_desk_settings « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 08106b04d18396e7125f69af5dda194c9c89116e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module ServiceDeskSettings
  class UpdateService < BaseService
    def execute
      settings = ServiceDeskSetting.safe_find_or_create_by!(project_id: project.id)

      unless ::Feature.enabled?(:service_desk_custom_address, project)
        params.delete(:project_key)
      end

      if settings.update(params)
        success
      else
        error(settings.errors.full_messages.to_sentence)
      end
    end
  end
end