FEATURE: Webhook for tag events

This commit is contained in:
Vinoth Kannan
2018-04-04 17:49:20 +05:30
parent 689144b2bf
commit 434cbc649f
10 changed files with 92 additions and 0 deletions

View File

@ -110,6 +110,7 @@ class TagsController < ::ApplicationController
tag.name = new_tag_name
if tag.save
StaffActionLogger.new(current_user).log_custom('renamed_tag', previous_value: params[:tag_id], new_value: new_tag_name)
DiscourseEvent.trigger(:tag_updated, tag)
render json: { tag: { id: new_tag_name } }
else
render_json_error tag.errors.full_messages