fix: delete a token with a negative quota will now update the account's quota correctly (close #51)
This commit is contained in:
parent
80065de8a3
commit
241ade2fae
@ -121,7 +121,7 @@ func DeleteTokenById(id int, userId int) (err error) {
|
||||
if quota > 0 {
|
||||
err = IncreaseUserQuota(userId, quota)
|
||||
} else {
|
||||
err = DecreaseUserQuota(userId, quota)
|
||||
err = DecreaseUserQuota(userId, -quota)
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user