diff options
Diffstat (limited to 'app/controllers/projects/hook_logs_controller.rb')
-rw-r--r-- | app/controllers/projects/hook_logs_controller.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/app/controllers/projects/hook_logs_controller.rb b/app/controllers/projects/hook_logs_controller.rb new file mode 100644 index 00000000000..745e89fc843 --- /dev/null +++ b/app/controllers/projects/hook_logs_controller.rb @@ -0,0 +1,33 @@ +class Projects::HookLogsController < Projects::ApplicationController + include HooksExecution + + before_action :authorize_admin_project! + + before_action :hook, only: [:show, :retry] + before_action :hook_log, only: [:show, :retry] + + respond_to :html + + layout 'project_settings' + + def show + end + + def retry + result = hook.execute(hook_log.request_data, hook_log.trigger) + + set_hook_execution_notice(result) + + redirect_to edit_project_hook_path(@project, @hook) + end + + private + + def hook + @hook ||= @project.hooks.find(params[:hook_id]) + end + + def hook_log + @hook_log ||= hook.web_hook_logs.find(params[:id]) + end +end |