Skip to content

Commit

Permalink
Remove now unused routes
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Jun 28, 2024
1 parent cb2e082 commit fec1048
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
33 changes: 0 additions & 33 deletions app/controllers/atdis_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,6 @@ def test
redirect_to get_involved_path
end

# The job here is to take ugly posted parameters and redirect to a much simpler url
sig { void }
def test_redirect
params_feed = T.cast(params[:feed], ActionController::Parameters)

@feed = Feed.new(
base_url: params_feed[:base_url],
page: params_feed[:page],
lodgement_date_start: params_feed[:lodgement_date_start],
lodgement_date_end: params_feed[:lodgement_date_end],
last_modified_date_start: params_feed[:last_modified_date_start],
last_modified_date_end: params_feed[:last_modified_date_end],
street: params_feed[:street],
suburb: params_feed[:suburb],
postcode: params_feed[:postcode]
)
if @feed.valid?
redirect_to atdis_test_url(url: @feed.url)
else
render "test"
end
end

sig { void }
def feed
file = Feed.example_path(params[:number], params[:page] || 1)
if File.exist?(file)
render file:, content_type: Mime[:json], layout: false
else
render plain: "not available", status: :not_found
end
end

# TODO: Move redirect to routes
sig { void }
def specification
Expand Down
2 changes: 0 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ def matches?(request)

namespace :atdis do
get :test
post :test, action: "test_redirect"
get "feed/:number/atdis/1.0/applications.json", action: "feed", as: :feed
get :specification
end

Expand Down

0 comments on commit fec1048

Please sign in to comment.