SU2-33 | Фикс критических и серьёзных ошибок, удаление/перезагрузка организации, пагинация, favicon

This commit is contained in:
Dmitry
2026-04-21 07:54:59 +00:00
parent a1cbddf4e2
commit 136de5f238
12 changed files with 127 additions and 28 deletions
+13 -2
View File
@@ -1,5 +1,5 @@
class OrganisationsController < ApplicationController
before_action :set_organisation, only: [:show]
before_action :set_organisation, only: [:show, :destroy, :reload]
DOC_TYPES = {
0 => { title: 'Бухгалтерский баланс', form_code: '1.1' },
@@ -9,7 +9,7 @@ class OrganisationsController < ApplicationController
}.freeze
def index
organizations = Organization.all
@pagy, organizations = pagy(Organization.order(:created_at))
@info_about_organisations = organizations.each_with_object({}) do |org, hash|
hash[org.id] = {
@@ -42,6 +42,17 @@ class OrganisationsController < ApplicationController
end
def destroy
@org.destroy!
redirect_to '/organisations/index', notice: "Организация #{@org.inn} удалена"
end
def reload
report = Report.create!(inn: @org.inn, status: 'processing')
FileProcessorJob.perform_async(@org.inn, report.id)
redirect_to "/organisations/#{@org.id}", notice: 'Данные обновляются в фоне'
end
private
def set_organisation