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.24.0.rc2 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.23.4 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.24.0.rc1 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.23.3 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.23.2 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.23.1 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.23.1.rc1 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.23.0 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.22.0 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.21.0 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.20.1 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.20.0 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.19.1 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.18.1 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.19.0 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.17.2 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.18.0 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.17.1 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.16.1 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
decidim-verifications-0.17.0 app/controllers/decidim/verifications/id_documents/admin/config_controller.rb