Commit a88f0a1f authored by Sebastian Klier's avatar Sebastian Klier

add wiki_page helper to url_builder

parent 559ef41d
......@@ -10,7 +10,8 @@ module WikiPages
# DEPRECATED
repository: @project.hook_attrs.slice(:name, :url, :description, :homepage)
}
page_url = "#{Gitlab.config.gitlab.url}#{@project.wiki.wiki_base_path}/#{page.slug}"
page_url = Gitlab::UrlBuilder.new(:wiki_page).build(page)
hook_data[:object_attributes].merge!(url: page_url, action: action)
hook_data
end
......
......@@ -20,6 +20,8 @@ module Gitlab
merge_request_url(object)
when Note
note_url
when WikiPage
wiki_page_url
else
raise NotImplementedError.new("No URL builder defined for #{object.class}")
end
......@@ -58,5 +60,9 @@ module Gitlab
project_snippet_url(snippet, anchor: dom_id(object))
end
end
def wiki_page_url
"#{Gitlab.config.gitlab.url}#{object.wiki.wiki_base_path}/#{object.slug}"
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment