summaryrefslogtreecommitdiff
path: root/lib/api/entities
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 12:09:47 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 12:09:47 +0000
commit8f9beefac3774b30e911fb00a68f4c7a5244cf27 (patch)
tree919c3a043f8c10bc3f78f3f6e029acfb6b972556 /lib/api/entities
parente4bf776a8829e5186a0f63603c0be627b891d80e (diff)
downloadgitlab-ce-8f9beefac3774b30e911fb00a68f4c7a5244cf27.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/entities')
-rw-r--r--lib/api/entities/note.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/entities/note.rb b/lib/api/entities/note.rb
index dcfb9a6d670..4d140454ff0 100644
--- a/lib/api/entities/note.rb
+++ b/lib/api/entities/note.rb
@@ -25,6 +25,14 @@ module API
# Avoid N+1 queries as much as possible
expose(:noteable_iid) { |note| note.noteable.iid if NOTEABLE_TYPES_WITH_IID.include?(note.noteable_type) }
+
+ expose(:commands_changes) { |note| note.commands_changes || {} }
+ end
+
+ # To be returned if the note was command-only
+ class NoteCommands < Grape::Entity
+ expose(:commands_changes) { |note| note.commands_changes || {} }
+ expose(:summary) { |note| note.errors[:commands_only] }
end
end
end