feat: auto provision tournament codes
This commit is contained in:
1 parent
65bc214fb2
commit
bac29ac933
13 files changed
+1164
-117
No files matched your search
+28
-14
@@ -36,6 +36,9 @@ export interface TeamParticipantView extends ParticipantView {
|
||||
export interface TeamView {
|
||||
teamIndex: number;
|
||||
name: string;
|
||||
captainUserId?: string;
|
||||
captainName?: string;
|
||||
captainTag?: string;
|
||||
participants: TeamParticipantView[];
|
||||
}
|
||||
|
||||
@@ -413,21 +416,32 @@ export function mapApiMatchToMatchDetail(match: ApiMatch): MatchDetailView {
|
||||
participants.map((participant) => [participant.userId, participant]),
|
||||
);
|
||||
|
||||
const teams = match.teams.map((team) => ({
|
||||
teamIndex: team.teamIndex,
|
||||
name: teamIndexLabel(team.teamIndex, team.name),
|
||||
participants: team.members.map((member) => {
|
||||
const participant =
|
||||
participantLookup.get(member.userId) ??
|
||||
createFallbackParticipant(member.userId);
|
||||
const teams = match.teams.map((team) => {
|
||||
const captain = team.captainUserId
|
||||
? participantLookup.get(team.captainUserId)
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
...participant,
|
||||
assignedPosition: member.assignedPosition,
|
||||
cost: member.cost,
|
||||
};
|
||||
}),
|
||||
}));
|
||||
return {
|
||||
teamIndex: team.teamIndex,
|
||||
name: teamIndexLabel(team.teamIndex, team.name),
|
||||
captainUserId: team.captainUserId,
|
||||
captainName:
|
||||
captain?.summonerName ??
|
||||
(team.captainUserId ? `User ${team.captainUserId.slice(-4)}` : undefined),
|
||||
captainTag: captain?.tag,
|
||||
participants: team.members.map((member) => {
|
||||
const participant =
|
||||
participantLookup.get(member.userId) ??
|
||||
createFallbackParticipant(member.userId);
|
||||
|
||||
return {
|
||||
...participant,
|
||||
assignedPosition: member.assignedPosition,
|
||||
cost: member.cost,
|
||||
};
|
||||
}),
|
||||
};
|
||||
});
|
||||
|
||||
const winnerTeam = match.result?.winnerTeamIndex
|
||||
? teams.find((team) => team.teamIndex === match.result?.winnerTeamIndex)
|
||||
|
||||
Reference in new issue
Block a user