diff options
| author | Douwe Maan <douwe@gitlab.com> | 2018-09-04 10:39:08 +0000 |
|---|---|---|
| committer | Douwe Maan <douwe@gitlab.com> | 2018-09-04 10:39:08 +0000 |
| commit | 4d41bbd711d95e8def52621db9213dccda348887 (patch) | |
| tree | cec2910cfe3c0065a88e884a60a588c548c0cae9 /lib/api/entities.rb | |
| parent | 0689900c7a5ce368c780f1fce8f465685bbfa9d6 (diff) | |
| parent | f9475e299c6f6b363d5ea302f1295a3ea0bf9adb (diff) | |
| download | gitlab-ce-4d41bbd711d95e8def52621db9213dccda348887.tar.gz | |
Merge branch 'fj-33475-files-inside-wiki-repo' into 'master'
Uploads to wiki stored inside the wiki git repository
Closes #33475
See merge request gitlab-org/gitlab-ce!21362
Diffstat (limited to 'lib/api/entities.rb')
| -rw-r--r-- | lib/api/entities.rb | 22 |
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 |
