summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/notes/components/issue_note_body.vue2
-rw-r--r--app/serializers/note_entity.rb2
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"
/>
<issue-note-attachment
- v-if="note.attachment.url"
+ v-if="note.attachment"
:attachment="note.attachment"
/>
</div>
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