mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
A trigger when a topic is updated, adds a couple of custom field tests
This commit is contained in:
@ -2,6 +2,7 @@ require_dependency 'topic_view'
|
||||
require_dependency 'promotion'
|
||||
require_dependency 'url_helper'
|
||||
require_dependency 'topics_bulk_action'
|
||||
require_dependency 'discourse_event'
|
||||
|
||||
class TopicsController < ApplicationController
|
||||
include UrlHelper
|
||||
@ -134,6 +135,8 @@ class TopicsController < ApplicationController
|
||||
success = PostRevisor.new(first_post, topic).revise!(current_user, changes, validate_post: false)
|
||||
end
|
||||
|
||||
DiscourseEvent.trigger(:topic_saved, topic, params)
|
||||
|
||||
# this is used to return the title to the client as it may have been changed by "TextCleaner"
|
||||
success ? render_serialized(topic, BasicTopicSerializer) : render_json_error(topic)
|
||||
end
|
||||
|
Reference in New Issue
Block a user