diff --git a/db/seed.ts b/db/seed.ts index 202dd59..510f93d 100644 --- a/db/seed.ts +++ b/db/seed.ts @@ -16,12 +16,17 @@ const players = [ { id: createId(), name: 'Elderflower' }, ]; -const playersInGame = players.slice(0, 3).map((player, index) => ({ - id: createId(), - gameId: games[0]?.id as string, - playerId: player.id, - position: index, -})); +const playersInGame = players + .slice(0, 3) + .map((player, index) => ({ + gameId: games[0]?.id as string, + playerId: player.id, + position: index, + })) + .map((playerInGame) => ({ + ...playerInGame, + id: `${playerInGame.gameId}-${playerInGame.playerId}`, + })); const scores = [ { diff --git a/src/actions/index.ts b/src/actions/index.ts index 437ffa6..5a1c2f7 100644 --- a/src/actions/index.ts +++ b/src/actions/index.ts @@ -19,6 +19,7 @@ export const server = { const game = { id: createHumanId() }; const playersInGame = players.map((player, index) => ({ + id: `${game.id}-${player.id}`, gameId: game.id, playerId: player.id, position: index,