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

This commit is contained in:
Martin Filser 2023-02-25 20:02:59 +01:00
parent 26e326a204
commit ea72ce1fa2
2 changed files with 3 additions and 3 deletions

View file

@ -334,12 +334,12 @@ if (Meteor.isServer) {
} }
}); });
const integrations = Integrations.find({ const integrations = ReactiveCache.getIntegrations({
boardId: { $in: [board._id, Integrations.Const.GLOBAL_WEBHOOK_ID] }, boardId: { $in: [board._id, Integrations.Const.GLOBAL_WEBHOOK_ID] },
// type: 'outgoing-webhooks', // all types // type: 'outgoing-webhooks', // all types
enabled: true, enabled: true,
activities: { $in: [description, 'all'] }, activities: { $in: [description, 'all'] },
}).fetch(); });
if (integrations.length > 0) { if (integrations.length > 0) {
params.watchers = watchers; params.watchers = watchers;
integrations.forEach(integration => { integrations.forEach(integration => {

View file

@ -142,7 +142,7 @@ if (Meteor.isServer) {
const paramBoardId = req.params.boardId; const paramBoardId = req.params.boardId;
Authentication.checkBoardAccess(req.userId, paramBoardId); Authentication.checkBoardAccess(req.userId, paramBoardId);
const data = Integrations.find( const data = ReactiveCache.getIntegrations(
{ boardId: paramBoardId }, { boardId: paramBoardId },
{ fields: { token: 0 } }, { fields: { token: 0 } },
).map(function(doc) { ).map(function(doc) {