From bc99cbddf9ef003ba18df3b7ed0aa348025e2009 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Tue, 27 Mar 2018 12:34:05 -0300 Subject: Expose note url --- app/serializers/note_entity.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/serializers/note_entity.rb b/app/serializers/note_entity.rb index 4ccf0bca476..9826ffb7156 100644 --- a/app/serializers/note_entity.rb +++ b/app/serializers/note_entity.rb @@ -1,5 +1,6 @@ class NoteEntity < API::Entities::Note include RequestAwareEntity + include NotesHelper expose :type @@ -57,6 +58,10 @@ class NoteEntity < API::Entities::Note end end + expose :noteable_note_url do |note| + noteable_note_url(note) + end + expose :resolve_path, if: -> (note, _) { note.part_of_discussion? && note.resolvable? } do |note| resolve_project_merge_request_discussion_path(note.project, note.noteable, note.discussion_id) end -- cgit v1.2.1