routing properly between teams

This commit is contained in:
Arjun Patel
2022-01-15 13:35:46 -08:00
parent 724b8c8e38
commit 87fb480956
2 changed files with 76 additions and 49 deletions
+8 -7
View File
@@ -254,13 +254,14 @@ export default class TeamService implements IService {
const userTeamMembers = await this.getTeamMembersByUserId(userId);
// traverse through and get the teams for each
var teams: Team[] = [];
userTeamMembers.map(async (tm) => {
if (tm.status != TeamMemberStatus.deleted) {
let team = await this.getTeam(tm.teamId);
teams.push(team);
}
});
const teams = await Promise.all(
userTeamMembers.map(async (tm) => {
if (tm.status != TeamMemberStatus.deleted) {
let team = await this.getTeam(tm.teamId);
return team;
}
})
);
return teams;
}