mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
UX: show if webhook is disabled (#7217)
+ show in staff logs when webhook is created/updated/destroyed
This commit is contained in:
@ -34,6 +34,7 @@ class Admin::WebHooksController < Admin::AdminController
|
||||
web_hook = WebHook.new(web_hook_params)
|
||||
|
||||
if web_hook.save
|
||||
StaffActionLogger.new(current_user).log_web_hook(web_hook, UserHistory.actions[:web_hook_create])
|
||||
render_serialized(web_hook, AdminWebHookSerializer, root: 'web_hook')
|
||||
else
|
||||
render_json_error web_hook.errors.full_messages
|
||||
@ -42,6 +43,7 @@ class Admin::WebHooksController < Admin::AdminController
|
||||
|
||||
def update
|
||||
if @web_hook.update_attributes(web_hook_params)
|
||||
StaffActionLogger.new(current_user).log_web_hook(@web_hook, UserHistory.actions[:web_hook_update], changes: @web_hook.saved_changes)
|
||||
render_serialized(@web_hook, AdminWebHookSerializer, root: 'web_hook')
|
||||
else
|
||||
render_json_error @web_hook.errors.full_messages
|
||||
@ -50,6 +52,7 @@ class Admin::WebHooksController < Admin::AdminController
|
||||
|
||||
def destroy
|
||||
@web_hook.destroy!
|
||||
StaffActionLogger.new(current_user).log_web_hook(@web_hook, UserHistory.actions[:web_hook_destroy])
|
||||
render json: success_json
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user