2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-07-29 10:34:21 -04:00
|
|
|
module Jobs
|
|
|
|
|
2019-10-02 00:01:53 -04:00
|
|
|
class UnpinTopic < ::Jobs::Base
|
2015-07-29 10:34:21 -04:00
|
|
|
|
|
|
|
def execute(args)
|
|
|
|
topic_id = args[:topic_id]
|
|
|
|
|
|
|
|
raise Discourse::InvalidParameters.new(:topic_id) unless topic_id.present?
|
|
|
|
|
|
|
|
topic = Topic.find_by(id: topic_id)
|
|
|
|
topic.update_pinned(false) if topic.present?
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|