mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
FEATURE: Allow custom date + time for bookmark reminders (#9185)
A custom date and time can now be selected for a bookmark reminder The reminder will not happen at the exact time but rather at the next 5 minute interval of the bookmark reminder schedule. This PR also fixes issues with bulk deleting topic bookmarks.
This commit is contained in:
@ -512,9 +512,13 @@ class PostsController < ApplicationController
|
||||
params.require(:post_id)
|
||||
|
||||
existing_bookmark = Bookmark.find_by(post_id: params[:post_id], user_id: current_user.id)
|
||||
existing_bookmark.destroy if existing_bookmark.present?
|
||||
topic_bookmarked = false
|
||||
|
||||
if existing_bookmark.present?
|
||||
topic_bookmarked = Bookmark.exists?(topic_id: existing_bookmark.topic_id, user_id: current_user.id)
|
||||
existing_bookmark.destroy
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user