Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xpub-faraday
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
xpub
xpub-faraday
Commits
9abc6e45
Commit
9abc6e45
authored
7 years ago
by
Sebastian
Browse files
Options
Downloads
Patches
Plain Diff
feat(component-invite): remove team from user on revoke
parent
ab245749
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/component-invite/src/helpers/Team.js
+1
-3
1 addition, 3 deletions
packages/component-invite/src/helpers/Team.js
packages/component-invite/src/routes/deleteInvitation.js
+3
-2
3 additions, 2 deletions
packages/component-invite/src/routes/deleteInvitation.js
with
4 additions
and
5 deletions
packages/component-invite/src/helpers/Team.js
+
1
−
3
View file @
9abc6e45
...
...
@@ -118,12 +118,10 @@ const getMatchingTeams = (teams, TeamModel, collectionId, role) =>
.
filter
(
Boolean
)
const
removeTeamMember
=
async
(
teamId
,
userId
,
TeamModel
)
=>
{
le
t
team
=
await
TeamModel
.
find
(
teamId
)
cons
t
team
=
await
TeamModel
.
find
(
teamId
)
const
members
=
team
.
members
.
filter
(
member
=>
member
!==
userId
)
team
.
members
=
members
team
=
await
team
.
updateProperties
(
team
)
await
team
.
save
()
}
...
...
This diff is collapsed.
Click to expand it.
packages/component-invite/src/routes/deleteInvitation.js
+
3
−
2
View file @
9abc6e45
...
...
@@ -28,7 +28,7 @@ module.exports = models => async (req, res) => {
const
{
collectionId
,
userId
}
=
req
.
params
try
{
const
collection
=
await
models
.
Collection
.
find
(
collectionId
)
le
t
user
=
await
models
.
User
.
find
(
userId
)
cons
t
user
=
await
models
.
User
.
find
(
userId
)
const
team
=
await
teamHelper
.
getTeamByGroupAndCollection
(
collectionId
,
role
,
...
...
@@ -42,8 +42,9 @@ module.exports = models => async (req, res) => {
return
}
await
inviteHelper
.
revokeInvitation
(
user
,
collectionId
,
role
)
user
=
await
models
.
User
.
find
(
userId
)
await
teamHelper
.
removeTeamMember
(
team
.
id
,
userId
,
models
.
Team
)
user
.
teams
=
user
.
teams
.
filter
(
userTeam
=>
team
.
id
!==
userTeam
.
id
)
await
user
.
save
()
await
collectionHelper
.
removeAssignedPeople
(
collection
,
user
.
email
)
try
{
await
mailService
.
setupRevokeInvitationEmail
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment