mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 00:00:46 +08:00
FEATURE: Improving bookmarks part 2 -- Topic Bookmarking (#8954)
### UI Changes If `SiteSetting.enable_bookmarks_with_reminders` is enabled: * Clicking "Bookmark" on a topic will create a new Bookmark record instead of a post + user action * Clicking "Clear Bookmarks" on a topic will delete all the new Bookmark records on a topic * The topic bookmark buttons control the post bookmark flags correctly and vice-versa Disabled selecting the "reminder type" for bookmarks in the UI because the backend functionality is not done yet (of sending users notifications etc.) ### Other Changes * Added delete bookmark route (but no UI yet) * Added a rake task to sync the old PostAction bookmarks to the new Bookmark table, which can be run as many times as we want for a site (it will not create duplicates).
This commit is contained in:
@ -514,7 +514,8 @@ class PostsController < ApplicationController
|
||||
existing_bookmark = Bookmark.find_by(post_id: params[:post_id], user_id: current_user.id)
|
||||
existing_bookmark.destroy if existing_bookmark.present?
|
||||
|
||||
render json: success_json
|
||||
topic_bookmarked = Bookmark.exists?(topic_id: existing_bookmark.topic_id, user_id: current_user.id)
|
||||
render json: success_json.merge(topic_bookmarked: topic_bookmarked)
|
||||
end
|
||||
|
||||
def wiki
|
||||
|
Reference in New Issue
Block a user