Welcome to mirror list, hosted at ThFree Co, Russian Federation.

base_service.rb « issues « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c3ca04a43438563e6e8eebb2258bee6103a66f44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Issues
  class BaseService < ::IssuableBaseService

    def hook_data(issue, action)
      issue_data = issue.to_hook_data(current_user)
      issue_url = Gitlab::UrlBuilder.new(:issue).build(issue.id)
      issue_data[:object_attributes].merge!(url: issue_url, action: action)
      issue_data
    end

    private

    def execute_hooks(issue, action = 'open')
      issue_data = hook_data(issue, action)
      issue.project.execute_hooks(issue_data, :issue_hooks)
      issue.project.execute_services(issue_data, :issue_hooks)
    end
  end
end