Declare api node relations as nested resources

This commit is contained in:
Anton Khorev 2025-02-02 13:38:46 +03:00
parent 6a50a5e871
commit a6e614e44e
10 changed files with 112 additions and 50 deletions

View file

@ -30,7 +30,6 @@ OpenStreetMap::Application.routes.draw do
post "changeset/comment/:id/hide" => "changeset_comments#destroy", :as => :changeset_comment_hide, :id => /\d+/
post "changeset/comment/:id/unhide" => "changeset_comments#restore", :as => :changeset_comment_unhide, :id => /\d+/
get "node/:id/relations" => "relations#relations_for_node", :as => :node_relations, :id => /\d+/
get "node/:id/history" => "old_nodes#history", :as => :api_node_history, :id => /\d+/
post "node/:id/:version/redact" => "old_nodes#redact", :as => :node_version_redact, :version => /\d+/, :id => /\d+/
get "node/:id/:version" => "old_nodes#show", :as => :api_old_node, :id => /\d+/, :version => /\d+/
@ -51,6 +50,7 @@ OpenStreetMap::Application.routes.draw do
resources :nodes, :path => "node", :id => /\d+/, :only => [:show, :update, :destroy] do
scope :module => :nodes do
resources :ways, :only => :index
resources :relations, :only => :index
end
end
put "node/create" => "nodes#create", :as => nil