Skip to content

Commit

Permalink
fix: don't add rootUser to teams
Browse files Browse the repository at this point in the history
  • Loading branch information
rlmartin committed Nov 17, 2024
1 parent f101aa8 commit df044ab
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/person.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,19 @@ export class Person<RoleType> extends BasePerson<PersonProps, RoleType> {
});
}

org.orgTeamIds.forEach((teamId, index) => {
// Ignore first team in list because it is added on user creation above.
if (index > 0) {
new zenduty.member.Member(this, `${this.slug}-${namespace}-member`, {
team: teamId,
user: this._user!.id,
role: teamRoleMap.get(zendutyRole),
});
}
});
// Assume that the rootUser is used to create teams and thus is already in the team
if (!rootUser) {
org.orgTeamIds.forEach((teamId, index) => {
// Ignore first team in list because it is added on user creation above.
if (index > 0) {
new zenduty.member.Member(this, `${this.slug}-${namespace}-member`, {
team: teamId,
user: this._user!.id,
role: teamRoleMap.get(zendutyRole),
});
}
});
}
}
}

Expand Down

0 comments on commit df044ab

Please sign in to comment.