fix: add userId to optimistic player in useCreatePlayer

Add temporary userId property to optimistic player object
to satisfy Player type requirements.

The Player type requires userId, but createPlayer only
accepts name/emoji/color. The optimistic update now includes
a temporary userId that gets replaced by the server response.

Fixes 1 TS2741 error in useUserPlayers.ts:108.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock
2025-10-07 15:38:53 -05:00
parent 4eb49d1d44
commit 5310463bec

View File

@@ -110,6 +110,7 @@ export function useCreatePlayer() {
...newPlayer,
createdAt: new Date(),
isActive: newPlayer.isActive ?? false,
userId: 'temp-user', // Temporary userId, will be replaced by server response
}
queryClient.setQueryData<Player[]>(playerKeys.list(), [
...previousPlayers,