dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 3226f79b76cd412720f673caa9fe56d743523a96
parent 4ac974ea0606e285ed57e81bdb479625718229cb
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat, 16 Dec 2023 23:49:10 -0500

move code

Diffstat:
Mpkg/database/tablePokerTables.go | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/pkg/database/tablePokerTables.go b/pkg/database/tablePokerTables.go @@ -90,6 +90,12 @@ func (d *DkfDB) GetPokerTableAccount(userID UserID, pokerTableID int64) (out Pok return } +func (d *DkfDB) PokerTableAccountResetAmountBet(userID UserID, pokerTableID int64) (err error) { + err = d.db.Exec(`UPDATE poker_table_accounts SET amount_bet = 0 WHERE user_id = ? AND poker_table_id = ?`, + userID, pokerTableID).Error + return +} + func (d *DkfDB) PokerTableAccountBet(userID UserID, pokerTableID int64, bet PokerChip) (err error) { err = d.db.Exec(`UPDATE poker_table_accounts SET amount = amount - ?, amount_bet = amount_bet + ? WHERE user_id = ? AND poker_table_id = ?`, bet, bet, userID, pokerTableID).Error @@ -102,12 +108,6 @@ func (d *DkfDB) PokerTableAccountRefundBet(userID UserID, pokerTableID int64) (e return } -func (d *DkfDB) PokerTableAccountResetAmountBet(userID UserID, pokerTableID int64) (err error) { - err = d.db.Exec(`UPDATE poker_table_accounts SET amount_bet = 0 WHERE user_id = ? AND poker_table_id = ?`, - userID, pokerTableID).Error - return -} - func (d *DkfDB) PokerTableAccountGain(userID UserID, pokerTableID int64, gain PokerChip) (err error) { err = d.db.Exec(`UPDATE poker_table_accounts SET amount = amount + ?, amount_bet = 0 WHERE user_id = ? AND poker_table_id = ?`, gain, userID, pokerTableID).Error