mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Move every Lists.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory server/)
This commit is contained in:
parent
2a2ed1eb2c
commit
76bd3bfe1d
3 changed files with 24 additions and 17 deletions
|
@ -53,15 +53,18 @@ Meteor.publishRelations('boards', function() {
|
|||
),
|
||||
function(boardId, board) {
|
||||
this.cursor(
|
||||
Lists.find(
|
||||
ReactiveCache.getLists(
|
||||
{ boardId, archived: false },
|
||||
{ fields: {
|
||||
_id: 1,
|
||||
title: 1,
|
||||
boardId: 1,
|
||||
archived: 1,
|
||||
sort: 1
|
||||
}}
|
||||
{ fields:
|
||||
{
|
||||
_id: 1,
|
||||
title: 1,
|
||||
boardId: 1,
|
||||
archived: 1,
|
||||
sort: 1
|
||||
}
|
||||
},
|
||||
true,
|
||||
)
|
||||
);
|
||||
this.cursor(
|
||||
|
@ -217,7 +220,7 @@ Meteor.publishRelations('board', function(boardId, isArchived) {
|
|||
true,
|
||||
),
|
||||
function(boardId, board) {
|
||||
this.cursor(Lists.find({ boardId, archived: isArchived }));
|
||||
this.cursor(ReactiveCache.getLists({ boardId, archived: isArchived }, {}, true));
|
||||
this.cursor(Swimlanes.find({ boardId, archived: isArchived }));
|
||||
this.cursor(Integrations.find({ boardId }));
|
||||
this.cursor(CardCommentReactions.find({ boardId }));
|
||||
|
|
|
@ -77,7 +77,7 @@ Meteor.publishRelations('popupCardData', function(cardId) {
|
|||
),
|
||||
function(cardId, card) {
|
||||
this.cursor(ReactiveCache.getBoards({_id: card.boardId}, {}, true));
|
||||
this.cursor(Lists.find({boardId: card.boardId}));
|
||||
this.cursor(ReactiveCache.getLists({boardId: card.boardId}, {}, true));
|
||||
},
|
||||
);
|
||||
const ret = this.ready()
|
||||
|
@ -787,7 +787,7 @@ function findCards(sessionId, query) {
|
|||
{ _id: { $in: swimlanes } },
|
||||
{ fields: { ...fields, color: 1 } },
|
||||
),
|
||||
Lists.find({ _id: { $in: lists } }, { fields }),
|
||||
ReactiveCache.getLists({ _id: { $in: lists } }, { fields }, true),
|
||||
CustomFields.find({ _id: { $in: customFieldIds } }),
|
||||
Users.find({ _id: { $in: users } }, { fields: Users.safeFields }),
|
||||
Checklists.find({ cardId: { $in: cards.map(c => c._id) } }),
|
||||
|
|
|
@ -74,13 +74,17 @@ Meteor.publish('notificationComments', function() {
|
|||
|
||||
// gets all lists associated with activities associated with the current user
|
||||
Meteor.publish('notificationLists', function() {
|
||||
const ret = Lists.find({
|
||||
_id: {
|
||||
$in: activities()
|
||||
.map(v => v.listId)
|
||||
.filter(v => !!v),
|
||||
const ret = ReactiveCache.getLists(
|
||||
{
|
||||
_id: {
|
||||
$in: activities()
|
||||
.map(v => v.listId)
|
||||
.filter(v => !!v),
|
||||
},
|
||||
},
|
||||
});
|
||||
{},
|
||||
true,
|
||||
);
|
||||
return ret;
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue