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

This commit is contained in:
Martin Filser 2023-02-25 20:19:18 +01:00
parent 59ee616304
commit f83ee124d0
5 changed files with 30 additions and 28 deletions

View file

@ -170,25 +170,25 @@ CustomFields.allow({
insert(userId, doc) {
return allowIsAnyBoardMember(
userId,
Boards.find({
ReactiveCache.getBoards({
_id: { $in: doc.boardIds },
}).fetch(),
}),
);
},
update(userId, doc) {
return allowIsAnyBoardMember(
userId,
Boards.find({
ReactiveCache.getBoards({
_id: { $in: doc.boardIds },
}).fetch(),
}),
);
},
remove(userId, doc) {
return allowIsAnyBoardMember(
userId,
Boards.find({
ReactiveCache.getBoards({
_id: { $in: doc.boardIds },
}).fetch(),
}),
);
},
fetch: ['userId', 'boardIds'],