diff options
author | Jarka Kadlecová <jarka@gitlab.com> | 2018-01-31 15:59:59 +0100 |
---|---|---|
committer | Jarka Kadlecová <jarka@gitlab.com> | 2018-02-06 16:02:02 +0100 |
commit | 7381944565701f2a8db5d58d5bc3c7e52e7f60bf (patch) | |
tree | a9bb7687b3809082555bd78dd5e1c5696d768910 /lib/api/entities.rb | |
parent | 0e15a5b805e832c22c67cead8c4829e6c77cd498 (diff) | |
download | gitlab-ce-7381944565701f2a8db5d58d5bc3c7e52e7f60bf.tar.gz |
Support search in API
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index e13463ec66b..7838de13c56 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -314,24 +314,20 @@ module API end end - class ProjectSnippet < Grape::Entity + class Snippet < Grape::Entity expose :id, :title, :file_name, :description expose :author, using: Entities::UserBasic expose :updated_at, :created_at - - expose :web_url do |snippet, options| + expose :project_id + expose :web_url do |snippet| Gitlab::UrlBuilder.build(snippet) end end - class PersonalSnippet < Grape::Entity - expose :id, :title, :file_name, :description - expose :author, using: Entities::UserBasic - expose :updated_at, :created_at + class ProjectSnippet < Snippet + end - expose :web_url do |snippet| - Gitlab::UrlBuilder.build(snippet) - end + class PersonalSnippet < Snippet expose :raw_url do |snippet| Gitlab::UrlBuilder.build(snippet) + "/raw" end @@ -1168,5 +1164,14 @@ module API class ApplicationWithSecret < Application expose :secret end + + class Blob < Grape::Entity + expose :basename + expose :data + expose :filename + expose :id + expose :ref + expose :startline + end end end |