From 3ef93db5a8dfb62f877731237a53fbdb8bc6e5f8 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 17 Aug 2017 15:00:10 +0200 Subject: [PATCH] Return null attachment when there is none --- app/assets/javascripts/notes/components/issue_note_body.vue | 2 +- app/serializers/note_entity.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/notes/components/issue_note_body.vue b/app/assets/javascripts/notes/components/issue_note_body.vue index d73717c6767..7d4333e4d27 100644 --- a/app/assets/javascripts/notes/components/issue_note_body.vue +++ b/app/assets/javascripts/notes/components/issue_note_body.vue @@ -112,7 +112,7 @@ :toggle-award-path="note.toggle_award_path" /> diff --git a/app/serializers/note_entity.rb b/app/serializers/note_entity.rb index e5295f5f34d..416730470dc 100644 --- a/app/serializers/note_entity.rb +++ b/app/serializers/note_entity.rb @@ -53,7 +53,7 @@ class NoteEntity < API::Entities::Note end end - expose :attachment, using: NoteAttachmentEntity + expose :attachment, using: NoteAttachmentEntity, if: -> (note, _) { note.attachment? } expose :delete_attachment_path, if: -> (note, _) { note.attachment? } do |note| delete_attachment_project_note_path(note.project, note) end