diff options
Diffstat (limited to 'lib/api/entities/note.rb')
-rw-r--r-- | lib/api/entities/note.rb | 8 |
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 |