Fix #4840: Forum post interface is not updated correctly after deletion.

Re-render and replace the whole forum post with AJAX when a forum post
is deleted or undeleted. This is easier now that forum posts are
componentized.
This commit is contained in:
evazion
2022-01-12 12:52:01 -06:00
parent 7ad24ef231
commit 5ba71f2a79
2 changed files with 2 additions and 2 deletions

View File

@@ -1 +1 @@
$("article[data-forum-post-id=<%= @forum_post.id %>] div.author div.author-name").append(" (deleted)");
$("#forum_post_<%= @forum_post.id %>").replaceWith("<%= j render(ForumPostComponent.new(forum_post: @forum_post, current_user: CurrentUser.user)) %>");

View File

@@ -1 +1 @@
location.reload();
$("#forum_post_<%= @forum_post.id %>").replaceWith("<%= j render(ForumPostComponent.new(forum_post: @forum_post, current_user: CurrentUser.user)) %>");