mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FEATURE: Add "Reset Bump Date" action to topic admin wrench (#6246)
This commit is contained in:
@ -33,7 +33,8 @@ class TopicsController < ApplicationController
|
||||
:move_to_inbox,
|
||||
:convert_topic,
|
||||
:bookmark,
|
||||
:publish
|
||||
:publish,
|
||||
:reset_bump_date
|
||||
]
|
||||
|
||||
before_action :consider_user_for_promotion, only: :show
|
||||
@ -720,6 +721,17 @@ class TopicsController < ApplicationController
|
||||
render_json_error(ex)
|
||||
end
|
||||
|
||||
def reset_bump_date
|
||||
params.require(:id)
|
||||
guardian.ensure_can_update_bumped_at!
|
||||
|
||||
topic = Topic.find_by(id: params[:id])
|
||||
raise Discourse::NotFound.new unless topic
|
||||
|
||||
topic.reset_bumped_at
|
||||
render body: nil
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def topic_params
|
||||
|
Reference in New Issue
Block a user