debian-mirror-gitlab/app/services/wiki_pages/create_service.rb

29 lines
462 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2016-06-02 11:05:42 +05:30
module WikiPages
class CreateService < WikiPages::BaseService
def execute
project_wiki = ProjectWiki.new(@project, current_user)
page = WikiPage.new(project_wiki)
if page.create(@params)
2020-04-22 19:07:51 +05:30
execute_hooks(page)
2016-06-02 11:05:42 +05:30
end
page
end
2020-04-22 19:07:51 +05:30
def usage_counter_action
:create
end
def external_action
'create'
end
def event_action
Event::CREATED
end
2016-06-02 11:05:42 +05:30
end
end