@cocreate/users 1.36.3 → 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,10 @@
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
+
1
8
  ## [1.36.3](https://github.com/CoCreate-app/CoCreate-users/compare/v1.36.2...v1.36.3) (2024-02-16)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/users",
3
- "version": "1.36.3",
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,7 +262,7 @@ class CoCreateUser {
261
262
  data.object = { '$pull.invitations': data.token, '$pull.members': data.email }
262
263
  data.$filter = {
263
264
  query: {
264
- // invitations: { $in: [data.token] },
265
+ invitations: { $in: [data.token] },
265
266
  members: { $in: [data.email] },
266
267
  limit: 2
267
268
  }
@@ -294,7 +295,7 @@ class CoCreateUser {
294
295
  self.wsManager.send(response)
295
296
 
296
297
  } catch (error) {
297
- console.log("Password reset failed", error);
298
+ console.log("Accept invite failed", error);
298
299
  }
299
300
  }
300
301