Skip to content

Commit

Permalink
Send team name and id (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlyrl committed Jan 29, 2021
1 parent 4912d5b commit 6b26191
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/controllers/teamController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ export const getInvitesForUser = async (req: Request, res: Response): Promise<vo

const invites = await inviteRepo
.createQueryBuilder('invite')
.leftJoinAndSelect('invite.team', 'team', 'team.id = invite.teamId')
.leftJoinAndSelect('invite.user', 'user', 'user.id = invite.userId')
.leftJoinAndSelect('user.application', 'application', 'user.applicationId = application.id')
.where('user.id = :userId', {userId: user.id})
Expand All @@ -335,7 +336,9 @@ export const getInvitesForUser = async (req: Request, res: Response): Promise<vo
uuid: invite.uuid,
firstName: invite.user?.application?.firstName,
lastName: invite.user?.application?.lastName,
discordUsername: invite.user?.discordUsername
discordUsername: invite.user?.discordUsername,
teamId: invite.team?.uuid,
teamName: invite.team?.name
});
}

Expand Down Expand Up @@ -382,7 +385,9 @@ export const getInvitesForTeam = async (req: Request, res: Response): Promise<vo
uuid: invite.uuid,
firstName: invite.user?.application?.firstName,
lastName: invite.user?.application?.lastName,
discordUsername: invite.user?.discordUsername
discordUsername: invite.user?.discordUsername,
teamId: invite.team?.uuid,
teamName: invite.team?.name
});
}

Expand Down

0 comments on commit 6b26191

Please sign in to comment.