Class: Decidim::Verifications::PostalLetter::Admin::PostagesController
- Inherits:
-
Admin::ApplicationController
- Object
- Admin::ApplicationController
- Decidim::Verifications::PostalLetter::Admin::PostagesController
- Includes:
- Admin::WorkflowsBreadcrumb
- Defined in:
- app/controllers/decidim/verifications/postal_letter/admin/postages_controller.rb
Overview
Handles postages for verification letters.
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/decidim/verifications/postal_letter/admin/postages_controller.rb', line 19 def create :update, :authorization, authorization: @pending_authorization @form = PostageForm.from_model(@pending_authorization) PerformAuthorizationStep.call(@pending_authorization, @form) do on(:ok) do flash[:notice] = t("postages.create.success", scope: "decidim.verifications.postal_letter.admin") redirect_to end on(:invalid) do render json: { error: I18n.t("postages.create.error", scope: "decidim.verifications.postal_letter.admin") }, status: :unprocessable_entity end end end |