mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
FEATURE: Allow editing bookmark reminders (#9437)
Users can now edit the bookmark name and reminder time from their list of bookmarks. We use "Custom" for the date and time in the modal because if the user set a reminder for "tomorrow" then edit the reminder "tomorrow", the definition of what "tomorrow" is has changed.
This commit is contained in:
@ -26,4 +26,22 @@ class BookmarksController < ApplicationController
|
||||
BookmarkManager.new(current_user).destroy(params[:id])
|
||||
render json: success_json
|
||||
end
|
||||
|
||||
def update
|
||||
params.require(:id)
|
||||
|
||||
bookmark_manager = BookmarkManager.new(current_user)
|
||||
bookmark_manager.update(
|
||||
bookmark_id: params[:id],
|
||||
name: params[:name],
|
||||
reminder_type: params[:reminder_type],
|
||||
reminder_at: params[:reminder_at]
|
||||
)
|
||||
|
||||
if bookmark_manager.errors.empty?
|
||||
return render json: success_json
|
||||
end
|
||||
|
||||
render json: failed_json.merge(errors: bookmark_manager.errors.full_messages), status: 400
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user