Class: Decidim::UploadValidationsController

Inherits:
ApplicationController show all
Includes:
FormFactory
Defined in:
app/controllers/decidim/upload_validations_controller.rb

Overview

The controller to handle upload validations

Instance Method Summary collapse

Methods included from UserBlockedChecker

#check_user_block_status, #check_user_not_blocked

Methods included from NeedsSnippets

#snippets

Methods included from HttpCachingDisabler

#disable_http_caching

Methods included from HasStoredPath

#skip_store_location?, #store_current_location

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/decidim/upload_validations_controller.rb', line 12

def create
  @form = form(Decidim::UploadValidationForm).from_params(params)

  ValidateUpload.call(@form) do
    on(:ok) do
      render json: []
    end

    on(:invalid) do |errors|
      render json: errors
    end
  end
end

#organization_time_zoneObject



26
27
28
29
30
# File 'app/controllers/decidim/upload_validations_controller.rb', line 26

def organization_time_zone
  return Rails.application.config.time_zone unless current_organization

  super
end