Răsfoiți Sursa

create list

itizawa 6 ani în urmă
părinte
comite
4e37d35681
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      src/server/models/user.js

+ 2 - 1
src/server/models/user.js

@@ -618,9 +618,10 @@ module.exports = function(crowi) {
     const User = this;
     const createdUserList = [];
 
-    // The user is exists
+    // check exists and get list of tyr to create
     const existingUserList = await User.find({ email: { $in: emailList }, userStatus: { $ne: STATUS_DELETED } });
     const existingEmailList = existingUserList.map((user) => { return user.email });
+    const creationEmailList = emailList.filter((email) => { return existingEmailList.indexOf(email) === -1 });
 
     // TODO GW-206 move to anothor function
     // const mailer = crowi.getMailer();