newGame create: newgame fist in a gamelist
This commit is contained in:
parent
c969007436
commit
907be9cbc0
@ -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 })
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user