fetching team data

This commit is contained in:
Arjun Patel
2022-01-15 13:02:44 -08:00
parent 39705c0493
commit 724b8c8e38
5 changed files with 115 additions and 7 deletions
+16
View File
@@ -248,4 +248,20 @@ export default class TeamService implements IService {
{ merge: true }
);
}
async getActiveOrInvitedTeamsbyUser(userId: string): Promise<Team[]> {
// get all of the teammember entries for the user
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);
}
});
return teams;
}
}