summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2018-09-04 10:39:08 +0000
committerDouwe Maan <douwe@gitlab.com>2018-09-04 10:39:08 +0000
commitf9475e299c6f6b363d5ea302f1295a3ea0bf9adb (patch)
treecec2910cfe3c0065a88e884a60a588c548c0cae9 /lib/api/entities.rb
parent0689900c7a5ce368c780f1fce8f465685bbfa9d6 (diff)
downloadgitlab-ce-f9475e299c6f6b363d5ea302f1295a3ea0bf9adb.tar.gz
Uploads to wiki stored inside the wiki git repository
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 59042d2b568..624eda3f5dd 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -10,6 +10,28 @@ module API
expose :content
end
+ 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
+ object.file_name
+ end
+
+ def secure_url
+ object.file_path
+ end
+ end
+
class UserSafe < Grape::Entity
expose :id, :name, :username
end