mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
FIX: User can't remove bookmark from a deleted post.
This commit is contained in:
@@ -383,9 +383,11 @@ class PostsController < ApplicationController
|
||||
PostAction.act(current_user, post, PostActionType.types[:bookmark])
|
||||
else
|
||||
post_action = PostAction.find_by(post_id: params[:post_id], user_id: current_user.id)
|
||||
post = post_action&.post
|
||||
raise Discourse::NotFound unless post_action
|
||||
|
||||
post = Post.with_deleted.find_by(id: post_action&.post_id)
|
||||
raise Discourse::NotFound unless post
|
||||
|
||||
PostAction.remove_act(current_user, post, PostActionType.types[:bookmark])
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user