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

create_service.rb « deploy_tokens « projects « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2e71650b066881205623b3086c2a67b79994ca1b (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 Projects
  module DeployTokens
    class CreateService < BaseService
      include DeployTokenMethods

      def execute
        deploy_token = create_deploy_token_for(@project, params)

        if deploy_token.persisted?
          success(deploy_token: deploy_token, http_status: :created)
        else
          error(deploy_token.errors.full_messages.to_sentence, :bad_request)
        end
      end
    end
  end
end