mirror of
https://github.com/wekan/wekan.git
synced 2025-04-24 05:57:13 -04:00
Move every Attachments.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory models/)
This commit is contained in:
parent
538e197147
commit
1067542b94
2 changed files with 4 additions and 3 deletions
|
@ -2259,8 +2259,8 @@ if (Meteor.isServer) {
|
|||
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
||||
JsonRoutes.sendResult(res, {
|
||||
code: 200,
|
||||
data: Attachments
|
||||
.find({'meta.boardId': paramBoardId })
|
||||
data: ReactiveCache
|
||||
.getAttachments({'meta.boardId': paramBoardId }, {}, true)
|
||||
.each()
|
||||
.map(function(attachment) {
|
||||
return {
|
||||
|
|
|
@ -794,9 +794,10 @@ Cards.helpers({
|
|||
},
|
||||
|
||||
attachments() {
|
||||
const ret = Attachments.find(
|
||||
const ret = ReactiveCache.getAttachments(
|
||||
{ 'meta.cardId': this.getRealId() },
|
||||
{ sort: { uploadedAt: -1 } },
|
||||
true,
|
||||
).each();
|
||||
return ret;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue