2020-01-26 10:09:11 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Entities
|
|
|
|
class WikiAttachment < Grape::Entity
|
|
|
|
include Gitlab::FileMarkdownLinkBuilder
|
|
|
|
|
|
|
|
expose :file_name
|
|
|
|
expose :file_path
|
|
|
|
expose :branch
|
|
|
|
expose :link do
|
|
|
|
expose :file_path, as: :url
|
|
|
|
expose :markdown do |_entity|
|
|
|
|
self.markdown_link
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def filename
|
2022-04-01 05:10:01 -04:00
|
|
|
object[:file_name]
|
2020-01-26 10:09:11 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def secure_url
|
2022-04-01 05:10:01 -04:00
|
|
|
object[:file_path]
|
2020-01-26 10:09:11 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|