2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
module WikiPages
|
|
|
|
class BaseService < ::BaseService
|
|
|
|
private
|
|
|
|
|
|
|
|
def execute_hooks(page, action = 'create')
|
2017-09-10 17:25:29 +05:30
|
|
|
page_data = Gitlab::DataBuilder::WikiPage.build(page, current_user, action)
|
2016-06-02 11:05:42 +05:30
|
|
|
@project.execute_hooks(page_data, :wiki_page_hooks)
|
|
|
|
@project.execute_services(page_data, :wiki_page_hooks)
|
2019-10-12 21:52:04 +05:30
|
|
|
increment_usage(action)
|
|
|
|
end
|
|
|
|
|
|
|
|
# This method throws an error if the action is an unanticipated value.
|
|
|
|
def increment_usage(action)
|
|
|
|
Gitlab::UsageDataCounters::WikiPageCounter.count(action)
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2019-12-04 20:38:33 +05:30
|
|
|
|
|
|
|
WikiPages::BaseService.prepend_if_ee('EE::WikiPages::BaseService')
|