Ignore:
Timestamp:
06/23/22 00:08:35 (2 years ago)
Author:
anastasovv <simon@…>
Branches:
main
Children:
ace7865
Parents:
285c3cc
Message:

Roulette place a bet functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • components/blackjack/PlayButtons.jsx

    r285c3cc r9bd09b0  
    44import { AiFillCheckCircle } from 'react-icons/ai'
    55
    6 import { setGame, setPlayer } from '../../redux/reducers/playerSlice';
     6import { setBlackjackGame, setPlayer } from '../../redux/reducers/playerSlice';
    77import { setBlackjack, setStyle } from '../../redux/reducers/styleSlice';
    88
     
    4646        axios.get(`/api/blackjack?action=make_initial_bet&session_id=${localStorage.CAESSINO_SESSION_ID}&bet=${styleState.blackjack.inputControls.initialBet.chosenCredits}`).then(res => {
    4747            if (res.data?.success) {
    48                 dispatch(setGame({
    49                     ...playerState.game,
     48                dispatch(setBlackjackGame({
     49                    ...playerState.blackjackGame,
    5050                    status: res.data?.status,
    5151                }))
     
    124124        const texts = splitTexts(e.target.innerHTML);
    125125
    126         dispatch(setGame({
    127             ...playerState.game,
     126        dispatch(setBlackjackGame({
     127            ...playerState.blackjackGame,
    128128            sideBetName: sideBetName
    129129        }))
     
    145145
    146146    function placeSideBetClicked() {
    147         axios.get(`/api/blackjack?action=make_side_bet&session_id=${localStorage.CAESSINO_SESSION_ID}&bet=${styleState.blackjack.inputControls.sideBet.chosenCredits}&betName=${playerState.game.sideBetName}`).then(res => {
    148             if (res.data?.success) {
    149                 dispatch(setGame({
    150                     ...playerState.game,
     147        axios.get(`/api/blackjack?action=make_side_bet&session_id=${localStorage.CAESSINO_SESSION_ID}&bet=${styleState.blackjack.inputControls.sideBet.chosenCredits}&betName=${playerState.blackjackGame.sideBetName}`).then(res => {
     148            if (res.data?.success) {
     149                dispatch(setBlackjackGame({
     150                    ...playerState.blackjackGame,
    151151                    status: res.data?.status,
    152152                }))
     
    201201        axios.get(`/api/blackjack?action=get_initial_cards&session_id=${localStorage.CAESSINO_SESSION_ID}`).then(res => {
    202202            if (res.data?.success) {
    203                 dispatch(setGame({
    204                     ...playerState.game,
     203                dispatch(setBlackjackGame({
     204                    ...playerState.blackjackGame,
    205205                    status: res.data?.status,
    206206                    playerCards: res.data?.playerCards,
     
    210210                if (res.data?.sideBetOutcome !== '') {
    211211                    if (res.data.sideBetOutcome === 'side_bet_won') {
    212                         dispatch(setGame({
    213                             ...playerState.game,
     212                        dispatch(setBlackjackGame({
     213                            ...playerState.blackjackGame,
    214214                            credits: res.data?.credits,
    215215                        }))
     
    250250        axios.get(`/api/blackjack?action=hit_a_card&session_id=${localStorage.CAESSINO_SESSION_ID}`).then(res => {
    251251            if (res.data?.success) {
    252                 dispatch(setGame({
    253                     ...playerState.game,
     252                dispatch(setBlackjackGame({
     253                    ...playerState.blackjackGame,
    254254                    status: res.data?.status,
    255255                    playerCards: res.data?.playerCards,
     
    284284        axios.get(`/api/blackjack?action=stand&session_id=${localStorage.CAESSINO_SESSION_ID}`).then(res => {
    285285            if (res.data?.success) {
    286                 dispatch(setGame({
    287                     ...playerState.game,
     286                dispatch(setBlackjackGame({
     287                    ...playerState.blackjackGame,
    288288                    status: res.data?.status,
    289289                    playerCards: res.data?.playerCards,
Note: See TracChangeset for help on using the changeset viewer.