This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/jobs/regular/make_embedded_topic_visible.rb

16 lines
335 B
Ruby

# frozen_string_literal: true
module Jobs
class MakeEmbeddedTopicVisible < ::Jobs::Base
def execute(args)
raise Discourse::InvalidParameters.new(:topic_id) if args[:topic_id].blank?
if topic = Topic.find_by(id: args[:topic_id])
topic.update_status('visible', true, topic.user)
end
end
end
end