refactor rna controller to use that new ability
This commit is contained in:
parent
7d65a34bc6
commit
396ebbcf2b
1 changed files with 1 additions and 8 deletions
|
@ -4,13 +4,6 @@ class Champs::RNAController < ApplicationController
|
|||
def show
|
||||
@champ = policy_scope(Champ).find(params[:champ_id])
|
||||
@rna = read_param_value(@champ.input_name, 'value')
|
||||
@network_error = false
|
||||
begin
|
||||
data = APIEntreprise::RNAAdapter.new(@rna, @champ.procedure_id).to_params
|
||||
@champ.update!(data: data, value: @rna)
|
||||
rescue APIEntreprise::API::Error, ActiveRecord::RecordInvalid => error
|
||||
@network_error = true if error.try(:network_error?) && !APIEntrepriseService.api_up?
|
||||
@champ.update(data: nil, value: nil)
|
||||
end
|
||||
@network_error = @champ.fetch_association!(@rna).present?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue