Skip to content
Snippets Groups Projects
Commit 232db215 authored by Sebastian Mihalache's avatar Sebastian Mihalache
Browse files

fix(component-user-manager): add submitting author as owner to collection"

parent c0eb479b
No related branches found
No related tags found
1 merge request!14Sprint #15
......@@ -81,12 +81,17 @@ module.exports = models => async (req, res) => {
})
}
await fragmentHelper.addAuthor({
fragmentHelper.addAuthor({
user,
isSubmitting,
isCorresponding,
})
if (!collection.owners.includes(user.id)) {
collection.owners.push(user.id)
collection.save()
}
return res.status(200).json({
...pick(user, authorKeys),
isSubmitting,
......@@ -125,6 +130,8 @@ module.exports = models => async (req, res) => {
})
if (!collection.owners.includes(newUser.id)) {
collection.owners.push(newUser.id)
collection.save()
mailService.sendSimpleEmail({
toEmail: newUser.email,
user: newUser,
......
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