approvals: move post approval endpoint to /post_approvals.

Move the post approval endpoint from `POST /moderator/post/approval` to
`POST /post_approvals`.
This commit is contained in:
evazion
2020-02-20 15:37:18 -06:00
parent 610ad9e119
commit f47c56d976
10 changed files with 30 additions and 48 deletions

View File

@@ -1,16 +0,0 @@
module Moderator
module Post
class ApprovalsController < ApplicationController
before_action :approver_only
skip_before_action :api_check
respond_to :json, :xml, :js
def create
cookies.permanent[:moderated] = Time.now.to_i
post = ::Post.find(params[:post_id])
@approval = post.approve!
respond_with(:moderator, @approval)
end
end
end
end

View File

@@ -1,5 +1,13 @@
class PostApprovalsController < ApplicationController
respond_to :html, :xml, :json
before_action :approver_only, only: [:create]
respond_to :html, :xml, :json, :js
def create
cookies.permanent[:moderated] = Time.now.to_i
post = Post.find(params[:post_id])
@approval = post.approve!
respond_with(@approval)
end
def index
@post_approvals = PostApproval.paginated_search(params)