post votes: fix exception when voting on posts using API.
Fix an `undefined method post_vote_url` exception when doing `POST https://danbooru.donmai.us/posts/1/votes.json`. Also add the following API endpoints: * https://danbooru.donmai.us/post_votes/:id.json * https://danbooru.donmai.us/comment_votes/:id.json * https://danbooru.donmai.us/forum_post_votes/:id.json where `:id` is the vote ID, not the post ID.
This commit is contained in:
@@ -89,7 +89,7 @@ Rails.application.routes.draw do
|
||||
post :approve
|
||||
end
|
||||
end
|
||||
resources :comment_votes, only: [:index, :destroy]
|
||||
resources :comment_votes, only: [:index, :show, :destroy]
|
||||
resources :comments do
|
||||
resource :votes, controller: "comment_votes", only: [:create, :destroy], as: "comment_votes"
|
||||
collection do
|
||||
@@ -134,7 +134,7 @@ Rails.application.routes.draw do
|
||||
get :search
|
||||
end
|
||||
end
|
||||
resources :forum_post_votes, only: [:index, :create, :destroy]
|
||||
resources :forum_post_votes, only: [:index, :show, :create, :destroy]
|
||||
resources :forum_topics do
|
||||
member do
|
||||
post :undelete
|
||||
@@ -189,7 +189,7 @@ Rails.application.routes.draw do
|
||||
end
|
||||
resources :post_regenerations, :only => [:create]
|
||||
resources :post_replacements, :only => [:index, :new, :create, :update]
|
||||
resources :post_votes, only: [:index]
|
||||
resources :post_votes, only: [:index, :show]
|
||||
|
||||
# XXX Use `only: []` to avoid redefining post routes defined at top of file.
|
||||
resources :posts, only: [] do
|
||||
|
||||
Reference in New Issue
Block a user