mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 03:10:12 +01: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);
|
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 {
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue