|
@@ -618,9 +618,10 @@ module.exports = function(crowi) {
|
|
|
const User = this;
|
|
const User = this;
|
|
|
const createdUserList = [];
|
|
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 existingUserList = await User.find({ email: { $in: emailList }, userStatus: { $ne: STATUS_DELETED } });
|
|
|
const existingEmailList = existingUserList.map((user) => { return user.email });
|
|
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
|
|
// TODO GW-206 move to anothor function
|
|
|
// const mailer = crowi.getMailer();
|
|
// const mailer = crowi.getMailer();
|