Kaynağa Gözat

use Query.prototype.exists()

Shun Miyazawa 2 yıl önce
ebeveyn
işleme
740d739b47
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  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;
       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) {
   userSchema.statics.updateIsInvitationEmailSended = async function(id) {