mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
Store when a topic was first set to auto-close and report that amount of time when it closes. And do some refactoring.
This commit is contained in:
@ -119,8 +119,7 @@ class TopicsController < ApplicationController
|
||||
raise Discourse::InvalidParameters.new(:auto_close_days) unless params.has_key?(:auto_close_days)
|
||||
@topic = Topic.where(id: params[:topic_id].to_i).first
|
||||
guardian.ensure_can_moderate!(@topic)
|
||||
@topic.auto_close_days = params[:auto_close_days]
|
||||
@topic.auto_close_user = current_user
|
||||
@topic.set_auto_close(params[:auto_close_days], current_user)
|
||||
@topic.save
|
||||
render nothing: true
|
||||
end
|
||||
|
Reference in New Issue
Block a user