Commit 3ef93db5 authored by Douwe Maan's avatar Douwe Maan

Return null attachment when there is none

parent 834f1b30
......@@ -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>
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment