Declare api way relations as nested resources

This commit is contained in:
Anton Khorev 2025-02-02 14:06:12 +03:00
parent a6e614e44e
commit 2a38dca0b7
10 changed files with 108 additions and 44 deletions

View file

@ -35,7 +35,6 @@ OpenStreetMap::Application.routes.draw do
get "node/:id/:version" => "old_nodes#show", :as => :api_old_node, :id => /\d+/, :version => /\d+/
get "way/:id/history" => "old_ways#history", :as => :api_way_history, :id => /\d+/
get "way/:id/relations" => "relations#relations_for_way", :as => :way_relations, :id => /\d+/
post "way/:id/:version/redact" => "old_ways#redact", :as => :way_version_redact, :version => /\d+/, :id => /\d+/
get "way/:id/:version" => "old_ways#show", :as => :api_old_way, :id => /\d+/, :version => /\d+/
@ -60,6 +59,9 @@ OpenStreetMap::Application.routes.draw do
member do
get :full, :action => :show, :full => true, :as => nil
end
scope :module => :ways do
resources :relations, :only => :index
end
end
put "way/create" => "ways#create", :as => nil