Return null attachment when there is none
This commit is contained in:
parent
834f1b30d5
commit
3ef93db5a8
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue