Changeset ace7865 for pages/api/postgre
- Timestamp:
- 06/25/22 11:30:19 (3 years ago)
- Branches:
- main
- Children:
- b13f93b
- Parents:
- 9bd09b0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pages/api/postgre/index.js
r9bd09b0 race7865 66 66 else if (req.query?.outcome === 'dealer_busted' || req.query?.outcome === 'player_won') { 67 67 pool.query('UPDATE stats SET blackjack_games = $1, blackjack_won_games = $2 WHERE username = $3', [parseInt(stats.blackjack_games) + 1, parseInt(stats.blackjack_won_games) + 1, session.username], (error, results) => { 68 if (error) throw error; 69 }); 70 } 71 } 72 else if (req.query?.game === 'roulette') { 73 if (req.query?.outcome === 'lost') { 74 pool.query('UPDATE stats SET roulette_games = $1 WHERE username = $2', [parseInt(stats.roulette_games) + 1, session.username], (error, results) => { 75 if (error) throw error; 76 }); 77 } 78 else if (req.query?.outcome === 'won') { 79 pool.query('UPDATE stats SET roulette_games = $1, roulette_won_games = $2 WHERE username = $3', [parseInt(stats.roulette_games) + 1, parseInt(stats.roulette_won_games) + 1, session.username], (error, results) => { 68 80 if (error) throw error; 69 81 });
Note:
See TracChangeset
for help on using the changeset viewer.