Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
nkurelli committed Jan 28, 2024
2 parents 78b3e3a + f393d29 commit 4184665
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/pages/api/user/match-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const client = DynamoDBDocument.from(new DynamoDB(config), {

export interface Match {
id: string;
player: string;
opponent: string;
player1: string;
player2: string;
map: string;
outcome: string;
type: string;
Expand Down Expand Up @@ -84,10 +84,8 @@ export default async function handler(
if (matchHistoryResult.Items) {
teamMatchData = matchHistoryResult.Items.map((item: any) => ({
id: item.match_id.N,
player: teamname,
opponent: item.players.L[0].M.current.B
? item.players.L[1].M.teamName.S
: item.players.L[0].M.teamName.S,
player1: item.players.L[0].M.teamName.S,
player2: item.players.L[1].M.teamName.S,
map: item.map ? item.map.S : 'Unknown',
outcome: item.placement ? item.placement.N.toString() : 'PENDING',
type: item.category.S,
Expand Down
6 changes: 4 additions & 2 deletions src/pages/user/scrimmages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ const TableRow: React.FC<{ match: Match }> = ({ match }) => {
return (
<tr style={{ backgroundColor }}>
<td>{match.id}</td>
<td>{match.opponent}</td>
<td>{match.player1}</td>
<td>{match.player2}</td>
<td>{match.map}</td>
<td>{match.status}</td>
<td>{match.outcome}</td>
Expand Down Expand Up @@ -225,7 +226,8 @@ const ScrimmagesTable: React.FC<{ data: Match[] }> = ({ data }) => (
<thead>
<tr>
<th>Match ID</th>
<th>Opponent</th>
<th>Player 1</th>
<th>Player 2</th>
<th>Map</th>
<th>Status</th>
<th>Outcome</th>
Expand Down

0 comments on commit 4184665

Please sign in to comment.