updateUserBalance: allow negative balances
This commit is contained in:
		
							parent
							
								
									4a0db10b20
								
							
						
					
					
						commit
						82c5eb85d3
					
				|  | @ -53,10 +53,10 @@ const updateUserBalance = ( | |||
| 
 | ||||
|     const newUserBalance = user.balance + delta | ||||
| 
 | ||||
|     if (newUserBalance < 0) | ||||
|       throw new Error( | ||||
|         `User (${userId}) balance cannot be negative: ${newUserBalance}` | ||||
|       ) | ||||
|     // if (newUserBalance < 0)
 | ||||
|     //   throw new Error(
 | ||||
|     //     `User (${userId}) balance cannot be negative: ${newUserBalance}`
 | ||||
|     //   )
 | ||||
| 
 | ||||
|     if (isDeposit) { | ||||
|       const newTotalDeposits = (user.totalDeposits || 0) + delta | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user