Skip to content
Snippets Groups Projects
Commit 7c45c3f4 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

Merge branch 'master' of gitlab.coko.foundation:xpub/xpub-faraday

parents c16455b2 b7fcd77f
No related branches found
No related tags found
No related merge requests found
...@@ -26,4 +26,12 @@ module.exports = { ...@@ -26,4 +26,12 @@ module.exports = {
collection.assignedPeople = assignedPeople collection.assignedPeople = assignedPeople
await collection.save() await collection.save()
}, },
updateAssignedPeople: async (collection, email) => {
const assignedPerson = collection.assignedPeople.find(
person => person.email === email,
)
assignedPerson.hasAnswer = true
assignedPerson.isAccepted = true
await collection.save()
},
} }
...@@ -42,6 +42,7 @@ module.exports = models => async (req, res) => { ...@@ -42,6 +42,7 @@ module.exports = models => async (req, res) => {
matchingInvitation.hasAnswer = true matchingInvitation.hasAnswer = true
if (accept === true) { if (accept === true) {
matchingInvitation.isAccepted = true matchingInvitation.isAccepted = true
await collectionHelper.updateAssignedPeople(collection, user.email)
try { try {
const users = await models.User.all() const users = await models.User.all()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment