BigW Consortium Gitlab

hook_logs_controller.rb 549 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
class Admin::HookLogsController < Admin::ApplicationController
  include HooksExecution

  before_action :hook, only: [:show, :retry]
  before_action :hook_log, only: [:show, :retry]

  respond_to :html

  def show
  end

  def retry
13
    result = hook.execute(hook_log.request_data, hook_log.trigger)
14

15
    set_hook_execution_notice(result)
16 17 18 19 20 21 22 23 24 25 26 27 28 29

    redirect_to edit_admin_hook_path(@hook)
  end

  private

  def hook
    @hook ||= SystemHook.find(params[:hook_id])
  end

  def hook_log
    @hook_log ||= hook.web_hook_logs.find(params[:id])
  end
end