diff --git a/app/controllers/administrateurs/api_tokens_controller.rb b/app/controllers/administrateurs/api_tokens_controller.rb index 9b35d5faa..7b4dd0381 100644 --- a/app/controllers/administrateurs/api_tokens_controller.rb +++ b/app/controllers/administrateurs/api_tokens_controller.rb @@ -13,11 +13,7 @@ module Administrateurs def autorisations @name = name - @libelle_id_procedures = current_administrateur - .procedures - .order(:libelle) - .pluck(:libelle, :id) - .map { |libelle, id| ["#{id} - #{libelle}", id] } + @libelle_id_procedures = libelle_id_procedures end def securite @@ -37,6 +33,7 @@ module Administrateurs end def edit + @libelle_id_procedures = libelle_id_procedures end def update @@ -74,6 +71,14 @@ module Administrateurs EOF end + def libelle_id_procedures + current_administrateur + .procedures + .order(:libelle) + .pluck(:libelle, :id) + .map { |libelle, id| ["#{id} - #{libelle}", id] } + end + def all_params [:name, :access, :target, :targets, :networkFiltering, :networks, :lifetime, :customLifetime] .index_with { |param| params[param] }