@resolveio/server-lib 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -109,7 +109,20 @@ function loadCronJobMethods(methodManager) {
109
109
  return new Promise(function (resolve, reject) {
110
110
  users.forEach(function (user) {
111
111
  user['client'] = _this.serverConfig['CLIENT_NAME'];
112
- user_collection_1.ClientUsers.updateOne({ _id: user._id }, { $setOnInsert: { _id: mongoose_1.Types.ObjectId().toHexString(), __v: 0 }, $set: user }, { upsert: true }).exec();
112
+ user_collection_1.ClientUsers.updateOne({
113
+ $and: [
114
+ { id_user: user._id },
115
+ { client: user['client'] }
116
+ ]
117
+ }, { $setOnInsert: {
118
+ _id: mongoose_1.Types.ObjectId().toHexString(),
119
+ __v: 0,
120
+ id_user: user._id,
121
+ fullname: user.fullname,
122
+ email: user.email,
123
+ client: user['client']
124
+ },
125
+ $set: { email: user.email } }, { upsert: true }).exec();
113
126
  });
114
127
  resolve();
115
128
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {