Skip to content

Commit

Permalink
fix: temp path for sending data to client db
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Feb 15, 2024
1 parent bffe1c1 commit f2bddae
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,14 @@ class CoCreateUser {
try {
const inviteId = this.crud.ObjectId().toString()
let uid = data.uid
delete data.uid
data.uid = data.uid + '-inv'

data.method = 'object.update'
data.array = "users"
data.object = { _id: data.user_id, '$addToSet.invitations': inviteId, '$addToSet.members': data.email }

data.object = { _id: data.user_id, '$push.invitations': inviteId, '$addToSet.members': data.email }
data.updateDB = true
data = await this.crud.send(data)
data.database = data.organization_id

let invitee = await this.crud.send({
method: 'object.read',
Expand Down Expand Up @@ -261,7 +262,7 @@ class CoCreateUser {
data.object = { '$pull.invitations': data.token, '$pull.members': data.email }
data.$filter = {
query: {
// invitations: { $in: [data.token] },
invitations: { $in: [data.token] },
members: { $in: [data.email] },
limit: 2
}
Expand Down Expand Up @@ -294,7 +295,7 @@ class CoCreateUser {
self.wsManager.send(response)

} catch (error) {
console.log("Password reset failed", error);
console.log("Accept invite failed", error);
}
}

Expand Down

0 comments on commit f2bddae

Please sign in to comment.