Przeglądaj źródła

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

Martin Filser 2 lat temu
rodzic
commit
f3d58339ae
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      models/team.js

+ 2 - 2
models/team.js

@@ -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 {