diff --git a/packages/component-user-manager/src/routes/fragmentsUsers/post.js b/packages/component-user-manager/src/routes/fragmentsUsers/post.js index b39f4ffa996a6da8ea5fb0b51ed686c3c94972ab..6edc714100c67b2aeff385fe0955f3fc64ac78ca 100644 --- a/packages/component-user-manager/src/routes/fragmentsUsers/post.js +++ b/packages/component-user-manager/src/routes/fragmentsUsers/post.js @@ -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,