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

fix(component-manuscript-manager): fix double teams in user

parent e58cf3c7
No related branches found
No related tags found
1 merge request!14Sprint #15
...@@ -72,18 +72,11 @@ module.exports = models => async (req, res) => { ...@@ -72,18 +72,11 @@ module.exports = models => async (req, res) => {
return userId return userId
}) })
const reviewersTeam = await teamHelper.createTeam({ teamHelper.createTeam({
role: 'reviewer', role: 'reviewer',
members: reviewerIds, members: reviewerIds,
objectType: 'fragment', objectType: 'fragment',
}) })
reviewerIds.forEach(id =>
userHelper.updateUserTeams({
userId: id,
teamId: reviewersTeam.id,
}),
)
} else { } else {
delete newFragment.invitations delete newFragment.invitations
await newFragment.save() await newFragment.save()
...@@ -110,13 +103,6 @@ module.exports = models => async (req, res) => { ...@@ -110,13 +103,6 @@ module.exports = models => async (req, res) => {
await authorsTeam.save() await authorsTeam.save()
} }
authorIds.forEach(id =>
userHelper.updateUserTeams({
userId: id,
teamId: authorsTeam.id,
}),
)
collectionHelper.updateStatusByRecommendation({ collectionHelper.updateStatusByRecommendation({
recommendation: heRecommendation.recommendation, recommendation: heRecommendation.recommendation,
}) })
......
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