From f2d52b55c8a1f0146535cb3ff21c268b9e55d60b Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Sat, 25 Feb 2023 19:30:38 +0100 Subject: [PATCH] Move every Org.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory models/) --- models/org.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/org.js b/models/org.js index ab5875263..b389d8a10 100644 --- a/models/org.js +++ b/models/org.js @@ -125,7 +125,7 @@ if (Meteor.isServer) { check(orgWebsite, String); check(orgIsActive, Boolean); - const nOrgNames = Org.find({ orgShortName }).count(); + const nOrgNames = ReactiveCache.getOrgs({ orgShortName }).length; if (nOrgNames > 0) { throw new Meteor.Error('orgname-already-taken'); } else { @@ -152,7 +152,7 @@ if (Meteor.isServer) { check(orgWebsite, String); check(orgIsActive, Boolean); - const nOrgNames = Org.find({ orgShortName }).count(); + const nOrgNames = ReactiveCache.getOrgs({ orgShortName }).length; if (nOrgNames > 0) { throw new Meteor.Error('orgname-already-taken'); } else {