Changeset 285c3cc for components/blackjack/PlayButtons.jsx
- Timestamp:
- 06/16/22 17:01:08 (2 years ago)
- Branches:
- main
- Children:
- 9bd09b0
- Parents:
- ebf5e04
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
components/blackjack/PlayButtons.jsx
rebf5e04 r285c3cc 44 44 45 45 function placeInitialBetClicked() { 46 axios.get(`/api/postgre?action=take_credits&session_id=${localStorage.CAESSINO_SESSION_ID}&credits=${styleState.blackjack.inputControls.initialBet.chosenCredits}`).then(postgreRes => { 47 if (postgreRes.data?.success) { 48 axios.get(`/api/blackjack?action=make_initial_bet&session_id=${localStorage.CAESSINO_SESSION_ID}&bet=${styleState.blackjack.inputControls.initialBet.chosenCredits}`).then(res => { 49 if (res.data?.success) { 50 dispatch(setGame({ 51 ...playerState.game, 52 status: res.data?.status, 53 })) 54 55 dispatch(setPlayer({ 56 ...playerState.player, 57 credits: postgreRes.data?.credits, 58 })) 59 60 dispatch(setBlackjack({ 61 ...styleState.blackjack, 62 displays: { 63 ...styleState.blackjack.displays, 64 initialBet: false, 65 sideBet: true, 66 } 67 })) 68 } 69 }); 46 axios.get(`/api/blackjack?action=make_initial_bet&session_id=${localStorage.CAESSINO_SESSION_ID}&bet=${styleState.blackjack.inputControls.initialBet.chosenCredits}`).then(res => { 47 if (res.data?.success) { 48 dispatch(setGame({ 49 ...playerState.game, 50 status: res.data?.status, 51 })) 52 53 dispatch(setPlayer({ 54 ...playerState.player, 55 credits: res.data?.credits, 56 })) 57 58 dispatch(setBlackjack({ 59 ...styleState.blackjack, 60 displays: { 61 ...styleState.blackjack.displays, 62 initialBet: false, 63 sideBet: true, 64 } 65 })) 70 66 } 71 67 }); … … 149 145 150 146 function placeSideBetClicked() { 151 axios.get(`/api/postgre?action=take_credits&session_id=${localStorage.CAESSINO_SESSION_ID}&credits=${styleState.blackjack.inputControls.sideBet.chosenCredits}`).then(postgreRes => { 152 if (postgreRes.data?.success) { 153 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 => { 154 if (res.data?.success) { 155 dispatch(setGame({ 156 ...playerState.game, 157 status: res.data?.status, 158 })) 159 160 dispatch(setPlayer({ 161 ...playerState.player, 162 credits: postgreRes.data?.credits, 163 })) 164 165 dispatch(setBlackjack({ 166 ...styleState.blackjack, 167 displays: { 168 ...styleState.blackjack.displays, 169 sideBetsChooseCreditsModal: false, 170 sideBet: false, 171 hitStand: true, 172 } 173 })) 174 175 getCards(); 176 } 177 }); 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, 151 status: res.data?.status, 152 })) 153 154 dispatch(setPlayer({ 155 ...playerState.player, 156 credits: res.data?.credits, 157 })) 158 159 dispatch(setBlackjack({ 160 ...styleState.blackjack, 161 displays: { 162 ...styleState.blackjack.displays, 163 sideBetsChooseCreditsModal: false, 164 sideBet: false, 165 hitStand: true, 166 } 167 })) 168 169 getCards(); 178 170 } 179 171 });
Note:
See TracChangeset
for help on using the changeset viewer.