Sha256: dab643c9a37a959adee063805e7a8f8a79896399edc1cc3edacf7f419aeb5242

Contents?: true

Size: 1.17 KB

Versions: 10

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

module Decidim
  module Verifications
    module IdDocuments
      module Admin
        #
        # Handles rejections for verification by identity document upload.
        #
        class RejectionsController < Decidim::Admin::ApplicationController
          layout "decidim/admin/users"

          before_action :load_pending_authorization

          include Decidim::Admin::WorkflowsBreadcrumb

          add_breadcrumb_item_from_menu :workflows_menu

          def create
            enforce_permission_to :update, :authorization, authorization: @pending_authorization

            @form = InformationRejectionForm.from_model(@pending_authorization)

            PerformAuthorizationStep.call(@pending_authorization, @form) do
              on(:ok) do
                flash[:notice] = t("rejections.create.success", scope: "decidim.verifications.id_documents.admin")
                redirect_to root_path
              end
            end
          end

          private

          def load_pending_authorization
            @pending_authorization = Authorization.find(params[:pending_authorization_id])
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-verifications-0.29.1 app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb
decidim-verifications-0.28.4 app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb
decidim-verifications-0.29.0 app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb
decidim-verifications-0.28.3 app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb
decidim-verifications-0.29.0.rc4 app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb
decidim-verifications-0.29.0.rc3 app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb
decidim-verifications-0.29.0.rc2 app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb
decidim-verifications-0.29.0.rc1 app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb
decidim-verifications-0.28.2 app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb
decidim-verifications-0.28.1 app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb