diff --git a/app/controllers/cards/previews_controller.rb b/app/controllers/cards/previews_controller.rb index aa8877d12..fdf646d2f 100644 --- a/app/controllers/cards/previews_controller.rb +++ b/app/controllers/cards/previews_controller.rb @@ -4,6 +4,6 @@ class Cards::PreviewsController < ApplicationController before_action :set_filter, only: :index def index - set_page_and_extract_portion_from @filter.cards, per_page: CardsController::PAGE_SIZE + set_page_and_extract_portion_from @filter.cards end end diff --git a/app/controllers/cards_controller.rb b/app/controllers/cards_controller.rb index 5dc851c2a..174c0270e 100644 --- a/app/controllers/cards_controller.rb +++ b/app/controllers/cards_controller.rb @@ -4,8 +4,6 @@ class CardsController < ApplicationController before_action :set_collection, only: %i[ create ] before_action :set_card, only: %i[ show edit update destroy ] - PAGE_SIZE = 25 - def index set_page_and_extract_portion_from @filter.cards end diff --git a/app/controllers/public/collections/card_previews_controller.rb b/app/controllers/public/collections/card_previews_controller.rb deleted file mode 100644 index f7572616a..000000000 --- a/app/controllers/public/collections/card_previews_controller.rb +++ /dev/null @@ -1,23 +0,0 @@ -class Public::Collections::CardPreviewsController < ApplicationController - include PublicCollectionScoped - - allow_unauthenticated_access only: :index - - def index - set_page_and_extract_portion_from find_cards, per_page: CardsController::PAGE_SIZE - end - - private - def find_cards - case params[:target] - when "considering-cards" - @collection.cards.considering.latest - when "doing-cards" - @collection.cards.doing.latest - when "closed-cards" - @collection.cards.closed.recently_closed_first - else - raise ActionController::BadRequest - end - end -end diff --git a/config/routes.rb b/config/routes.rb index 5e187e3e1..1431c1836 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -161,8 +161,6 @@ Rails.application.routes.draw do namespace :public do resources :collections do scope module: :collections do - resources :card_previews - namespace :columns do resource :not_now, only: :show resource :stream, only: :show diff --git a/test/controllers/public/collections/card_previews_controller_test.rb b/test/controllers/public/collections/card_previews_controller_test.rb deleted file mode 100644 index eedb89118..000000000 --- a/test/controllers/public/collections/card_previews_controller_test.rb +++ /dev/null @@ -1,9 +0,0 @@ -require "test_helper" - -class Public::Collections::CardPreviewsControllerTest < ActionDispatch::IntegrationTest - setup do - sign_in_as :kevin - - collections(:writebook).publish - end -end