Commit 0da8428f8efb7af188deb3e85ca911efbfb0e59e

Authored by Mart Sõmermaa
1 parent 731c009a

Expose event and and mergerequest timestamps in API, make code more DRY.

Showing 2 changed files with 6 additions and 4 deletions   Show diff stats
CHANGELOG
... ... @@ -15,6 +15,7 @@ v 6.8.0
15 15 - Option to disable standard login
16 16 - Clean old created archives from repository downloads directory
17 17 - Fix download link for huge MR diffs
  18 + - Expose event and mergerequest timestamps in API
18 19  
19 20 v 6.7.3
20 21 - Fix the merge notification email not being sent (Pierre de La Morinerie)
... ...
lib/api/entities.rb
... ... @@ -117,22 +117,22 @@ module API
117 117 class ProjectEntity < Grape::Entity
118 118 expose :id, :iid
119 119 expose (:project_id) { |entity| entity.project.id }
  120 + expose :title, :description
  121 + expose :state, :created_at, :updated_at
120 122 end
121 123  
122 124 class Milestone < ProjectEntity
123   - expose :title, :description, :due_date, :state, :updated_at, :created_at
  125 + expose :due_date
124 126 end
125 127  
126 128 class Issue < ProjectEntity
127   - expose :title, :description
128 129 expose :label_list, as: :labels
129 130 expose :milestone, using: Entities::Milestone
130 131 expose :assignee, :author, using: Entities::UserBasic
131   - expose :state, :updated_at, :created_at
132 132 end
133 133  
134 134 class MergeRequest < ProjectEntity
135   - expose :target_branch, :source_branch, :title, :state, :upvotes, :downvotes, :description
  135 + expose :target_branch, :source_branch, :upvotes, :downvotes
136 136 expose :author, :assignee, using: Entities::UserBasic
137 137 expose :source_project_id, :target_project_id
138 138 end
... ... @@ -158,6 +158,7 @@ module API
158 158 expose :title, :project_id, :action_name
159 159 expose :target_id, :target_type, :author_id
160 160 expose :data, :target_title
  161 + expose :created_at
161 162 end
162 163  
163 164 class Namespace < Grape::Entity
... ...