mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Attachment selection, simpler code logic
This commit is contained in:
parent
11f8b17a05
commit
b6374dac3d
1 changed files with 7 additions and 9 deletions
|
|
@ -739,17 +739,15 @@ Cards.helpers({
|
|||
},
|
||||
|
||||
attachments() {
|
||||
let id = this._id;
|
||||
if (this.isLinkedCard()) {
|
||||
return Attachments.find(
|
||||
{ 'meta.cardId': this.linkedId },
|
||||
{ sort: { uploadedAt: -1 } },
|
||||
).each();
|
||||
} else {
|
||||
return Attachments.find(
|
||||
{ 'meta.cardId': this._id },
|
||||
{ sort: { uploadedAt: -1 } },
|
||||
).each();
|
||||
id = this.linkedId;
|
||||
}
|
||||
let ret = Attachments.find(
|
||||
{ 'meta.cardId': id },
|
||||
{ sort: { uploadedAt: -1 } },
|
||||
).each();
|
||||
return ret;
|
||||
},
|
||||
|
||||
cover() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue