Skip to content

Commit

Permalink
fix key errors in games table from lichess
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed Oct 20, 2023
1 parent 089973d commit e81b536
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/lichess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,12 @@ export async function convertToNormalized(
data: PositionGames
): Promise<NormalizedGame[]> {
return await Promise.all(
data.map(async (game) => {
data.map(async (game, i) => {
const pgn = await getLichessGame(game.id);
const { headers, root } = await parsePGN(pgn);
const normalized: NormalizedGame = {
...headers,
id: i,
white_id: 0,
black_id: 0,
event_id: 0,
Expand Down

0 comments on commit e81b536

Please sign in to comment.