Project

General

Profile

Download (860 Bytes) Statistics
| Branch: | Tag: | Revision:

foreman_pipeline / app / controllers / foreman_pipeline / api / jenkins_project_params_controller.rb @ be52ca64

1
module ForemanPipeline
2
  class Api::JenkinsProjectParamsController < Katello::Api::V2::ApiController
3
    respond_to :json
4

    
5
    include Api::Rendering
6

    
7
    before_filter :find_jenkins_project_param, :only => [:update]
8

    
9
    def update
10
      @jenkins_project_param.update_attributes!(jenkins_project_param_params)
11
      @jenkins_project_param.save!
12
      respond_for_show(:resource => @jenkins_project_param)
13
    end
14

    
15
    private
16
    
17
    def find_jenkins_project_param
18
      @jenkins_project_param = JenkinsProjectParam.find_by_id(params[:id])
19
      fail ::Katello::HttpErrors::NotFound, "Could not find Jenkins Project Param with id: #{params[:id]}" if @jenkins_project_param.nil?
20
      @jenkins_project_param
21
    end
22

    
23
    def jenkins_project_param_params
24
      params.require(:jenkins_project_param).permit(:name, :type, :value, :description)
25
    end
26
  end
27
end