Move every Attachments.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory models/)

This commit is contained in:
Martin Filser 2023-03-12 18:33:38 +01:00
parent 538e197147
commit 1067542b94
2 changed files with 4 additions and 3 deletions

View file

@ -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 {

View file

@ -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;
},