about summary refs log tree commit diff
path: root/config/routes.rb
diff options
context:
space:
mode:
authorLevi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>2022-05-16 09:29:01 +0200
committerGitHub <noreply@github.com>2022-05-16 09:29:01 +0200
commit94e98864e39c010635e839fea984f2b4893bef1a (patch)
tree7a24465db019e89b4fe079a58918cf00c9acbf58 /config/routes.rb
parentdc350be6f5a9f59385e6fbc7a06b5b9c0d57aec8 (diff)
Allow import/export of instance-level domain blocks/allows (#1754)
* Allow import/export of instance-level domain blocks/allows.
Fixes #15095

* Pacify circleci

* Address simple code review feedback

* Add headers to exported CSV

* Extract common import/export functionality to
AdminExportControllerConcern

* Add additional fields to instance-blocked domain export

* Address review feedback

* Split instance domain block/allow import/export into separate pages/controllers

* Address code review feedback

* Pacify DeepSource

* Work around Paperclip::HasAttachmentFile for Rails 6

* Fix deprecated API warning in export tests

* Remove after_commit workaround
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 574715705..787665192 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -194,7 +194,21 @@ Rails.application.routes.draw do
     get '/dashboard', to: 'dashboard#index'
 
     resources :domain_allows, only: [:new, :create, :show, :destroy]
-    resources :domain_blocks, only: [:new, :create, :destroy, :update, :edit]
+    resources :domain_blocks, only: [:new, :create, :show, :destroy, :update, :edit]
+
+    resources :export_domain_allows, only: [:new] do
+      collection do
+        get :export, constraints: { format: :csv }
+        post :import
+      end
+    end
+
+    resources :export_domain_blocks, only: [:new] do
+      collection do
+        get :export, constraints: { format: :csv }
+        post :import
+      end
+    end
 
     resources :email_domain_blocks, only: [:index, :new, :create] do
       collection do