From eb746848fecfa352094b10c9b1cd8bfa9d55fd1b Mon Sep 17 00:00:00 2001 From: Sebastian Mihalache <sebastian.mihalache@gmail.con> Date: Wed, 11 Jul 2018 15:51:59 +0300 Subject: [PATCH] fix(component-manuscript-manager): fix double teams in user --- .../src/routes/fragments/patch.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/component-manuscript-manager/src/routes/fragments/patch.js b/packages/component-manuscript-manager/src/routes/fragments/patch.js index 92cbaf906..944fd2863 100644 --- a/packages/component-manuscript-manager/src/routes/fragments/patch.js +++ b/packages/component-manuscript-manager/src/routes/fragments/patch.js @@ -72,18 +72,11 @@ module.exports = models => async (req, res) => { return userId }) - const reviewersTeam = await teamHelper.createTeam({ + teamHelper.createTeam({ role: 'reviewer', members: reviewerIds, objectType: 'fragment', }) - - reviewerIds.forEach(id => - userHelper.updateUserTeams({ - userId: id, - teamId: reviewersTeam.id, - }), - ) } else { delete newFragment.invitations await newFragment.save() @@ -110,13 +103,6 @@ module.exports = models => async (req, res) => { await authorsTeam.save() } - authorIds.forEach(id => - userHelper.updateUserTeams({ - userId: id, - teamId: authorsTeam.id, - }), - ) - collectionHelper.updateStatusByRecommendation({ recommendation: heRecommendation.recommendation, }) -- GitLab