mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10: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() {
|
attachments() {
|
||||||
|
let id = this._id;
|
||||||
if (this.isLinkedCard()) {
|
if (this.isLinkedCard()) {
|
||||||
return Attachments.find(
|
id = this.linkedId;
|
||||||
{ 'meta.cardId': this.linkedId },
|
|
||||||
{ sort: { uploadedAt: -1 } },
|
|
||||||
).each();
|
|
||||||
} else {
|
|
||||||
return Attachments.find(
|
|
||||||
{ 'meta.cardId': this._id },
|
|
||||||
{ sort: { uploadedAt: -1 } },
|
|
||||||
).each();
|
|
||||||
}
|
}
|
||||||
|
let ret = Attachments.find(
|
||||||
|
{ 'meta.cardId': id },
|
||||||
|
{ sort: { uploadedAt: -1 } },
|
||||||
|
).each();
|
||||||
|
return ret;
|
||||||
},
|
},
|
||||||
|
|
||||||
cover() {
|
cover() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue