Explorar o código

Fixing method in users.js didn't have check userId

Sam X. Chen %!s(int64=5) %!d(string=hai) anos
pai
achega
a37723f8a4
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      models/users.js

+ 1 - 0
models/users.js

@@ -541,6 +541,7 @@ Users.mutations({
 Meteor.methods({
   setUsername(username, userId) {
     check(username, String);
+    check(userId, String);
     const nUsersWithUsername = Users.find({ username }).count();
     if (nUsersWithUsername > 0) {
       throw new Meteor.Error('username-already-taken');