@cocreate/users 1.36.2 → 1.36.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.36.4](https://github.com/CoCreate-app/CoCreate-users/compare/v1.36.3...v1.36.4) (2024-02-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * temp path for sending data to client db ([f2bddae](https://github.com/CoCreate-app/CoCreate-users/commit/f2bddae22bbe183d9fb64fe175d8abd3a4d70082))
7
+
8
+ ## [1.36.3](https://github.com/CoCreate-app/CoCreate-users/compare/v1.36.2...v1.36.3) (2024-02-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * socket and limit handling ([b700208](https://github.com/CoCreate-app/CoCreate-users/commit/b700208286629b4f5bef0b7e4a14d7767f69eb21))
14
+
1
15
  ## [1.36.2](https://github.com/CoCreate-app/CoCreate-users/compare/v1.36.1...v1.36.2) (2024-02-15)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/users",
3
- "version": "1.36.2",
3
+ "version": "1.36.4",
4
4
  "description": "A simple users component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "users",
package/src/server.js CHANGED
@@ -159,13 +159,14 @@ class CoCreateUser {
159
159
  try {
160
160
  const inviteId = this.crud.ObjectId().toString()
161
161
  let uid = data.uid
162
- delete data.uid
162
+ data.uid = data.uid + '-inv'
163
163
 
164
164
  data.method = 'object.update'
165
165
  data.array = "users"
166
- data.object = { _id: data.user_id, '$addToSet.invitations': inviteId, '$addToSet.members': data.email }
167
-
166
+ data.object = { _id: data.user_id, '$push.invitations': inviteId, '$addToSet.members': data.email }
167
+ data.updateDB = true
168
168
  data = await this.crud.send(data)
169
+ data.database = data.organization_id
169
170
 
170
171
  let invitee = await this.crud.send({
171
172
  method: 'object.read',
@@ -261,9 +262,9 @@ class CoCreateUser {
261
262
  data.object = { '$pull.invitations': data.token, '$pull.members': data.email }
262
263
  data.$filter = {
263
264
  query: {
264
- // invites: { $in: [data.token] },
265
+ invitations: { $in: [data.token] },
265
266
  members: { $in: [data.email] },
266
- limit: 1
267
+ limit: 2
267
268
  }
268
269
  }
269
270
 
@@ -282,7 +283,6 @@ class CoCreateUser {
282
283
  for (let object of data.object) {
283
284
  if (object._id) {
284
285
  delete data.$filter
285
- data.socket = socket
286
286
  data.object = { _id: object._id, '$addToSet.members': data.user_id }
287
287
  data = await this.crud.send(data)
288
288
  this.crud.send({ method: 'object.update', host: data.host, array: 'users', object: { _id: data.user_id, memberAccount: object._id, subscription: '6571fe530c48ef6970900a82' } })
@@ -295,7 +295,7 @@ class CoCreateUser {
295
295
  self.wsManager.send(response)
296
296
 
297
297
  } catch (error) {
298
- console.log("Password reset failed", error);
298
+ console.log("Accept invite failed", error);
299
299
  }
300
300
  }
301
301