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:
@@ -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
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user