Sha256: db84bd291934ab4e697e6980e44b74f66f2d0e6221df4e56719f0372f5f79e0e

Contents?: true

Size: 1.17 KB

Versions: 61

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

module Decidim
  module Verifications
    module IdDocuments
      module Admin
        #
        # Handles the configuration for the ID documents verification
        #
        class ConfigController < Decidim::Admin::ApplicationController
          layout "decidim/admin/users"

          def edit
            enforce_permission_to :update, :organization, organization: current_organization

            @form = form(ConfigForm).from_model(current_organization)
          end

          def update
            enforce_permission_to :update, :organization, organization: current_organization

            @form = form(ConfigForm).from_params(params)

            UpdateConfig.call(@form) do
              on(:ok) do
                flash[:notice] = t("config.update.success", scope: "decidim.verifications.id_documents.admin")
                redirect_to pending_authorizations_path
              end

              on(:invalid) do
                flash.now[:alert] = t("config.update.error", scope: "decidim.verifications.id_documents.admin")
                render action: :edit
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
decidim-verifications-0.27.9 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.27.8 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.27.7 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.27.6 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.26.10 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.26.9 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.28.0 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.27.5 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.28.0.rc5 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.28.0.rc4 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.26.8 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.27.4 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.27.3 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.26.7 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.26.5 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.27.2 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.27.1 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.26.4 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.27.0 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.26.3 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb