summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index ac166ed4fba..96920718ab5 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -147,6 +147,11 @@ module API
expose :state, :created_at, :updated_at
end
+ class RepoDiff < Grape::Entity
+ expose :old_path, :new_path, :a_mode, :b_mode, :diff
+ expose :new_file, :renamed_file, :deleted_file
+ end
+
class Milestone < ProjectEntity
expose :due_date
end
@@ -166,6 +171,12 @@ module API
expose :milestone, using: Entities::Milestone
end
+ class MergeRequestChanges < MergeRequest
+ expose :diffs, as: :changes, using: Entities::RepoDiff do |compare, _|
+ compare.diffs
+ end
+ end
+
class SSHKey < Grape::Entity
expose :id, :title, :key, :created_at
end
@@ -236,11 +247,6 @@ module API
expose :name, :color
end
- class RepoDiff < Grape::Entity
- expose :old_path, :new_path, :a_mode, :b_mode, :diff
- expose :new_file, :renamed_file, :deleted_file
- end
-
class Compare < Grape::Entity
expose :commit, using: Entities::RepoCommit do |compare, options|
Commit.decorate(compare.commits).last