Procházet zdrojové kódy

use Query.prototype.exists()

Shun Miyazawa před 2 roky
rodič
revize
740d739b47
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      apps/app/src/server/models/user.js

+ 2 - 2
apps/app/src/server/models/user.js

@@ -717,8 +717,8 @@ module.exports = function(crowi) {
       return false;
     }
 
-    const isExist = (await this.count({ username })) > 0;
-    return isExist;
+    const user = await this.exists({ username });
+    return user != null;
   };
 
   userSchema.statics.updateIsInvitationEmailSended = async function(id) {