Skip to content
Snippets Groups Projects
Commit b7fcd77f authored by Sebastian's avatar Sebastian
Browse files

feat(component-invite): update assigned people when he agree

parent ac9a0955
No related branches found
No related tags found
No related merge requests found
......@@ -26,4 +26,12 @@ module.exports = {
collection.assignedPeople = assignedPeople
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) => {
matchingInvitation.hasAnswer = true
if (accept === true) {
matchingInvitation.isAccepted = true
await collectionHelper.updateAssignedPeople(collection, user.email)
try {
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