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

This commit is contained in:
Martin Filser 2023-02-25 19:34:44 +01:00
parent 67c6dd7bee
commit f3d58339ae

View file

@ -123,7 +123,7 @@ if (Meteor.isServer) {
check(teamWebsite, String);
check(teamIsActive, Boolean);
const nTeamNames = Team.find({ teamShortName }).count();
const nTeamNames = ReactiveCache.getTeams({ teamShortName }).length;
if (nTeamNames > 0) {
throw new Meteor.Error('teamname-already-taken');
} else {
@ -149,7 +149,7 @@ if (Meteor.isServer) {
check(teamShortName, String);
check(teamWebsite, String);
check(teamIsActive, Boolean);
const nTeamNames = Team.find({ teamShortName }).count();
const nTeamNames = ReactiveCache.getTeams({ teamShortName }).length;
if (nTeamNames > 0) {
throw new Meteor.Error('teamname-already-taken');
} else {