newGame create: newgame fist in a gamelist

This commit is contained in:
djmil 2023-11-14 12:04:16 +01:00
parent c969007436
commit 907be9cbc0

View File

@ -22,7 +22,7 @@ export default function useGamesApi(gamesReducer, config) {
pushNewGame: (reqParams) => doPushing('/api/gameproposal', 'POST', reqParams, { pushNewGame: (reqParams) => doPushing('/api/gameproposal', 'POST', reqParams, {
onPushing: (isPushingNewGame) => dispatchGames({ type: 'next', isPushingNewGame }), onPushing: (isPushingNewGame) => dispatchGames({ type: 'next', isPushingNewGame }),
onSuccess: (game) => dispatchGames({ type: 'next', gamesList: [...games.gamesList, game], newGame: emptyNewGame }) onSuccess: (game) => dispatchGames({ type: 'next', gamesList: [game, ...games.gamesList], newGame: emptyNewGame })
}), }),
} }
} }