approvals: remove post undelete endpoint.
Remove `POST /moderator/post/undelete` endpoint. Replace it with `POST /post_approvals` instead. Fixes it so that undeleting a post has the same behavior as approving a post. Namely, it reloads the page instead of just flashing a "Post was undeleted" message.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module Moderator
|
||||
module Post
|
||||
class PostsController < ApplicationController
|
||||
before_action :approver_only, :only => [:delete, :undelete, :move_favorites, :ban, :unban, :confirm_delete, :confirm_move_favorites, :confirm_ban]
|
||||
before_action :approver_only, :only => [:delete, :move_favorites, :ban, :unban, :confirm_delete, :confirm_move_favorites, :confirm_ban]
|
||||
before_action :admin_only, :only => [:expunge]
|
||||
skip_before_action :api_check
|
||||
|
||||
@@ -19,11 +19,6 @@ module Moderator
|
||||
redirect_to(post_path(@post))
|
||||
end
|
||||
|
||||
def undelete
|
||||
@post = ::Post.find(params[:id])
|
||||
@post.approve!
|
||||
end
|
||||
|
||||
def confirm_move_favorites
|
||||
@post = ::Post.find(params[:id])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user