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); Authentication.checkBoardAccess(req.userId, paramBoardId);
JsonRoutes.sendResult(res, { JsonRoutes.sendResult(res, {
code: 200, code: 200,
data: Attachments data: ReactiveCache
.find({'meta.boardId': paramBoardId }) .getAttachments({'meta.boardId': paramBoardId }, {}, true)
.each() .each()
.map(function(attachment) { .map(function(attachment) {
return { return {

View file

@ -794,9 +794,10 @@ Cards.helpers({
}, },
attachments() { attachments() {
const ret = Attachments.find( const ret = ReactiveCache.getAttachments(
{ 'meta.cardId': this.getRealId() }, { 'meta.cardId': this.getRealId() },
{ sort: { uploadedAt: -1 } }, { sort: { uploadedAt: -1 } },
true,
).each(); ).each();
return ret; return ret;
}, },