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:
evazion
2020-02-20 15:46:39 -06:00
parent f47c56d976
commit faf852d18e
6 changed files with 20 additions and 31 deletions

View File

@@ -42,7 +42,7 @@
<% if CurrentUser.can_approve_posts? %>
<% if post.is_deleted? %>
<li id="post-option-undelete"><%= link_to "Undelete", undelete_moderator_post_post_path(post_id: post.id), remote: true, method: :post, "data-confirm": "Are you sure you want to undelete this post?" %></li>
<li id="post-option-undelete"><%= link_to "Undelete", post_approvals_path(post_id: post.id), remote: true, method: :post, "data-confirm": "Are you sure you want to undelete this post?" %></li>
<% if post.fav_count > 0 && post.parent_id %>
<li id="post-option-move-favorites"><%= link_to "Move favorites", confirm_move_favorites_moderator_post_post_path(post_id: post.id) %></li>
<% end %>