mirror of
https://github.com/wekan/wekan.git
synced 2025-12-23 19:00:12 +01:00
Move every Attachments.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory client/)
This commit is contained in:
parent
f83ee124d0
commit
14ac099e87
2 changed files with 3 additions and 3 deletions
|
|
@ -41,7 +41,7 @@ Template.attachmentGallery.events({
|
||||||
});
|
});
|
||||||
|
|
||||||
function getNextAttachmentId(currentAttachmentId) {
|
function getNextAttachmentId(currentAttachmentId) {
|
||||||
const attachments = Attachments.find({'meta.cardId': cardId}).get();
|
const attachments = ReactiveCache.getAttachments({'meta.cardId': cardId});
|
||||||
|
|
||||||
let i = 0;
|
let i = 0;
|
||||||
for (; i < attachments.length; i++) {
|
for (; i < attachments.length; i++) {
|
||||||
|
|
@ -53,7 +53,7 @@ function getNextAttachmentId(currentAttachmentId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPrevAttachmentId(currentAttachmentId) {
|
function getPrevAttachmentId(currentAttachmentId) {
|
||||||
const attachments = Attachments.find({'meta.cardId': cardId}).get();
|
const attachments = ReactiveCache.getAttachments({'meta.cardId': cardId});
|
||||||
|
|
||||||
let i = 0;
|
let i = 0;
|
||||||
for (; i < attachments.length; i++) {
|
for (; i < attachments.length; i++) {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ BlazeComponent.extendComponent({
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
getBoardsWithAttachments() {
|
getBoardsWithAttachments() {
|
||||||
this.attachments = Attachments.find().get();
|
this.attachments = ReactiveCache.getAttachments();
|
||||||
this.attachmentsByBoardId = _.chain(this.attachments)
|
this.attachmentsByBoardId = _.chain(this.attachments)
|
||||||
.groupBy(fileObj => fileObj.meta.boardId)
|
.groupBy(fileObj => fileObj.meta.boardId)
|
||||||
.value();
|
.value();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue